General Characteristics of Localization in Stratified Media with Random Loss and Gain