Comparative study of the phonons in nonsuperconducting BaC6 and superconducting CaC6 using inelastic x-ray scattering