The Loss of Nitrogen-rich Atmospheres from Earth-like Exoplanets within M-star Habitable Zones