Characterizing the beam properties of terahertz quantum-cascade lasers