Electrochemically driven variation of magnetic properties in ultrathin CoPt films