Change ThreadPool`s tasks_remaining_ to atomic<int>