fix bug that libvirt may crash when remove instance