Shutting down pool in case of exceptions