A Novel Terahertz Frequency Measurement Method Based on the Fabry–Pérot Resonator