Multithreading pool resource closing fix