libvirt: Remove unused variable 'detail' and change some testFail to testError

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