Comparative study of the pressure effects on the magnetic penetration depth in electron- and hole-doped cuprate superconductors