[PATCH v2 3/8] os-posix: refactor code handling the -chroot argument