On the effect of the martian crustal magnetic field on atmospheric erosion