Properly terminate process pool