xrdp-ng: move some authentication code out of xrdp-ng-sesman