Fix compatibility issues with DragonFly queue.h.

- Define *_FOREACH_SAFE if not provided by the system.

- Wrap RB_NFIND() to account for systems that don't have it.

- Add semicolons after {RB,SPLAY}_{PROTOTYPE,GENERATE}. This makes gcc
  complain more with -pedantic on FreeBSD-like queues.h, unfortunately.

- Note issues with SOCK_NONBLOCK, and temporarily define to 0 if not
  present.
Fix flat netid handling of local identifiers.
Add LAN support to main menu.

Yay, the whole stack works.