Novel gain measurement method without optical fiber alignment in a semiconductor optical amplifier