Real-time terahertz imaging with a single-pixel detector