IMF-induced escape of molecular ions from the Martian ionosphere