Measurement of Quadratic Terahertz Optical Nonlinearities Using Second-Harmonic Lock-in Detection