register shutdown for closing the threadpool