Fix for threads in pool exiting