Fix compiler errors for gcc 2.8.
Fix tests to work on Linux (epoll doesn't support actual file descriptors).