Top Mecklenburg County magistrate resigns