Electrosynthesis of N-(halo)vinylamides