libvirt-test: Backup virsh_change_media xml and fix virsh_edit.

Added backup and restore for vm in virsh_change_media.py.
Fix virsh_edit.py to get consistent result in earlier version of libvirt.
Fix some errors.
Fix some pep8/pylint.