Diff reduce with upstream and consolidate #ifdefs where possible
Note that sys/types.h is required on FreeBSD for kqueue(2), unlike NetBSD MFC after: 12 days X-MFC with: r305358 Sponsored by: Dell EMC Isilon
- Omit the poll testcases on FreeBSD (they require pollts) - Add necessary headers for the testcases Sponsored by: EMC / Isilon Storage Division