nn_socket() returns -1 on error

fix #6