Bug in nn_term fixed

nn_term can be called even if there is no socket open

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