Misc portability improvements to help bring wayland to darwin
With these changes (and some others to adopt epoll-shim that I'm not ready to upstream yet), I'm able to build wayland on darwin with -Dtests=false -Ddocumentation=false -Ddtd_validation=false
.