ThreadPool: Add missing lock.