An alleged paedophile accused of raping and killing a four-year-old girl has been dragged out of his cell and killed.