[libvirt PATCH v2 09/20] commandhelper: Factor out printEnvironment