netcat from OpenBSD

Stripped out some OpenBSD stuff to make this more portable
