Localization in a disordered multi-mode waveguide with absorption or amplification