Stochastic resonance in noise-induced transitions between self-oscillations and equilibria in spin-valve nanomagnets