Electrical measurement of magnetic-field-impeded polarity switching of a ferromagnetic vortex core