Controlling chaos in ferromagnetic resonance