Effect of inelastic scattering processes on (p, t) reactions exciting the first 2+ states in Te, Sn and Cd isotopes