HPCC-9415 Use epoll, fix critical section around init

Signed-off-by: Mark Kelly <mark.kelly@lexisnexis.com>