epoll: optimizations and cleanups