improve usage of cleanup paths
improve usage of cleanup paths

This removes several code duplicates and also some unusual code structures.

Signed-off-by: Pavel Hrdina <d4772d05997b8abf035041e3b4f4996380ea7e7a@redhat.com>

libvirt/libvirt-python,libvirt/libvirt-python,libvirt/libvirt-python