Automatic feedback control of an Er-doped fiber laser with an intracavity loss modulator