Suppression of non-radiative processes in semiconductor mid-infrared emitters and detectors