Fixed the Thread Pool related crash on closing a windows application.