Refactor NS_POLL case in mg_ev_handler