Fix kqueue test on non-Apple BSDs.

On non-Apple kqueue implementations, you need to include `<sys/types.h>` manually.