libvirt.virsh_change_media: Fix a ShellCmdError bug and add env recover ...

Remake of virt-test PR 1286.

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>