Reduction of EDFA optical power transients using power shaping