A customized change to release thread pool at the end of each parallel region