Electron loss to the continuum for H2+ and He+ ions colliding with H2, He, Ne and Ar. I. Electron cusp widths and shapes