Refactored difficult thread pool test.