libvirt.test: Fix bugs in undefine test

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