[PATCH v2 2/8] os-posix: refactor code handling the -runas argument