Theoretical analysis of spectral gain in a terahertz quantum-cascade laser: Prospects for gain at 1 THz