[libvirt PATCH] tests: avoid referencing stale readdir pointer