Mechanism by which water and protein electrostatic interactions control proton transfer at the active site of channelrhodopsin