Fix intermittent failure with multiple threads trying to stop()