Accidentally disabled TCP tests enabled again

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Bug fix in nn_device(); device unit test added

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
nn_device implementation moved to src/core/device.c

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
nn_device code slightly simplified

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