Do cosmic rays heat the early intergalactic medium?