Electrochemical and photoelectrochemical insertion and transport of hydrogen in pyrite