Neutron spectroscopic study of crystal field excitations in Tb2Ti2O7 and Tb2Sn2O7