Functioning Photoelectrochemical Devices Studied with Time-Resolved Terahertz Spectroscopy