The response function of a CsI(Tl) scintillator with photodiode readout to light and heavy ions in the intermediate energy range