Destructor. Close the socket if it's still opened.
References get_socket_fd(), get_trigger_events(), and handle_event().