Weak approximation for cubic hypersurfaces