xrdp-ng: refactor server_paint_rect