Retry epoll_ctl() with EPOLL_CTL_MOD if adding fails

While reading The Net it was clear that epoll() implementation wasn't
without its bugs. Seems that calling epoll_ctl() with EPOLL_CTL_ADD may
fail with EINVAL in some cases when file descriptor was duplicated.
Workaround for some of them is to try EPOLL_CTL_MOD. Hope that there was
no confusion, but this patch can't harm. Yeah, famous last words.