Implemented thread pool destruction