Strong resistance nonlinearity and third harmonic generation in the unipolar resistance switching of NiO thin films