Neutron-proton mass difference in isospin-asymmetric nuclear matter