Closing the listen socket on error