add close method to sockets
port all tests from catwell/luajit-nanomsg-old