Sometimes when the user does ctrl+c to quit, it may not quit if nothing comes on the socket. Closing the socket in the signal handler fixes this.