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