[threads] Correct the spin waiting in 'sleep_interruptable' (#3544)