improved handling of errors in EPOLL loop