moved Poller and unique_fd from main to util, fixed c++ issues in util