Fixed potential race condition in TestableDaemon.stops() and becomesIdle().