[libvirt PATCH v2 07/10] remote: extract logic for determining daemon to connect to