Synchronization and Spin-Flop Transitions for a Mean-Field XY Model in Random Field