Effects of secondary electron emission on electron trap measurements in the magnetosphere and solar wind