general: Add compatibility code & #ifdefs
This is enough to get knet compiling on FreeBSD 11 and bits of it
working. It's nowhere near ready on BSD though, more work is needed,
but given the fast pace of development it's best to get this in now
rather than track it in a separate branch.
Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>