Active gain control in cascades of EDFAs by pump compensation