Analysis of Ti valence states in resistive switching regions of a rutile TiO2−x four-terminal memristive device