Better cleanup of thread pool tests.