Fix compilation on FreeBSD 8 and Ruby 1.9

Reordered headers for FreeBSD 8

Define PCAP_NETMASK_UNKNOWN for old libpcap in FreeBSD 8

Conditionally require ruby/thread.h for Ruby 1.9

Define NUM2USHORT (possibly poorly) for Ruby 1.9
Ignore .so and .dll files
Work around ether_ntoa platform differences

A 0 may or may not be included in the address
Work around non-portable PF_* values

Different BSD flavors have different values for PF_INET6, so use them
all like tcpdump does.