Avoid potential deadlock in AsioService if ThreadCount() is called on an asio thread during Stop().