An investigation is under way after the death of a South Yorkshire prisoner.