Origin of tri-state resistive switching characteristics in SiCN thin films for high-temperature ReRAM applications