Loss of stability of self-oscillations close to resonance and versal deformations of equivariant vector fields