xrdp-ng: refactor listener and sesman to make use of event handles