socket finalizer to ensure nn_sockets get closed