Back-port ns_open_listening_socket() change from mongoose