Ricciardo admits he thought replacing Perez ‘could happen’