OS X fixes

I am not sure if the build product is usable yet (will test later) but at least this prevents any build errors to occur. That is quite surprising because I expected the epoll stuff to generate build errors.