Processes during the electrorefining and electrowinning of lead