The Influence of Photoelectron and Secondary Electron Emission on Electric Field Measurements in the Magnetosphere and Solar Wind