Quantum phase properties of the field in a micromaser: Effect of cooperative atomic interactions, cavity losses and pump fluctuations