Reduction of stray-current attack in electrochemical machining