Close the socket in finally, so we don't hang on error.