Finite-temperature radiative corrections to early universe neutron-proton ratio: Cancellation of infrared and mass singularities