[PATCH v1 32/34] qemuDomainNamespaceTeardownChardev: Deduplicate code