Influence of magnetism on phonons in CaFe2As2 as seen via inelastic x-ray scattering