Relaxation time and critical slowing down of a spin-torque oscillator