Spin–phonon coupling and thermodynamic behaviour in YCrO3 and LaCrO3: inelastic neutron scattering and lattice dynamics