Properly shutdown pool to avoid hang at end of lifecycle