Fixing thread pool shutdown management