Quantum-limited frequency fluctuations in a terahertz laser