[libvirt PATCH 6/9] remote: extract logic for determining daemon to connect to