tests: use nc instead of telnet to connect to linuxcncrsh

And add a build-dependency on netcat so it actually works on
minimal installs like pbuilder.

Thanks to Michael Haberler for the bug report.
tests: better waiting for linuxcncrsh to come up

Poll the listening socket with 'nc -z' instead of blindly
hoping 4 seconds is enough.

Note that linuxcncrsh is not yet ready to talk to clients when
it creates its listening socket, so we still need a short sleep
in there.  :-/

Thanks to Michael Haberler for the bug report and the fix.
tests: ask linuxcncrsh to keep up with its input better

This might fix a shutdown race in this test reported by Michael
Haberler.