Moment-based, self-consistent linear analysis of gyrotron oscillators