Efficient technique for intracavity loss optimization in a dual-wavelength erbium-doped fiber laser