Modification of magnetic stability of Co single atoms on Pt(111) by dimer formation