Diffuse galactic continuum emission measured by COMPTEL and the cosmic-ray electron spectrum