Create function nn_usock_close to handle socket close and  PIPE close at the same time.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>