close thread pool when it ends