Magnetic coupling in neutral and charged Cr2, Mn2, and CrMn dimers