Fix issue 915 (Failed to find kqueue on FreeBSD) with the relevant portion of a patch submitted to node.js dev (http://groups.google.com/group/nodejs-dev/browse_thread/thread/3aaf7fe2ca390fdc) by Davie Siegel. The issue is that event.h requires types.h on FreeBSD. This rearranges some of the logic but looks like it should still be valid for Darwin.