Detection of gate oxide charge trapping by second-harmonic generation