Time-resolved optical emission spectroscopy during pulsed dc magnetron sputter deposition of Ti and TiO2 thin films