Modification of Mesoporous TiO2 Films by Electrochemical Doping: Impact on Photoelectrocatalytic and Photovoltaic Performance