Possible fix for randomly exiting all threads in pool