libvirt-tests: change_media: Fix a ShellCmdError bug and add environment recover to 'try finally' part

Signed-off-by: Li Yang <liyang.fnst@cn.fujitsu.com>