Terahertz wavefronts measured using the Hartmann sensor principle