tests: Resolve Coverity RESOURCE_LEAK
tests: Resolve Coverity RESOURCE_LEAK

In the error path need to unref the 'caps' as well

Signed-off-by: John Ferlan <87558058f6f829e5ec976c8ef960720af4ff9c7d@redhat.com>

jardasgit/libvirt,andreabolognani/libvirt,jfehlig/libvirt,libvirt/libvirt,rlaager/libvirt,taget/libvirt,libvirt/libvirt,agx/libvirt,datto/libvirt,jardasgit/libvirt,fabianfreyer/libvirt,zippy2/libvirt,jardasgit/libvirt,jfehlig/libvirt,VenkatDatta/libvirt,eskultety/libvirt,jardasgit/libvirt,agx/libvirt,eskultety/libvirt,fabianfreyer/libvirt,datto/libvirt,fabianfreyer/libvirt,andreabolognani/libvirt,taget/libvirt,libvirt/libvirt,nertpinx/libvirt,taget/libvirt,crobinso/libvirt,andreabolognani/libvirt,datto/libvirt,crobinso/libvirt,VenkatDatta/libvirt,jardasgit/libvirt,jfehlig/libvirt,VenkatDatta/libvirt,fabianfreyer/libvirt,nertpinx/libvirt,agx/libvirt,nertpinx/libvirt,rlaager/libvirt,olafhering/libvirt,rlaager/libvirt,VenkatDatta/libvirt,olafhering/libvirt,olafhering/libvirt,eskultety/libvirt,datto/libvirt,rlaager/libvirt,crobinso/libvirt,fabianfreyer/libvirt,nertpinx/libvirt,datto/libvirt,zippy2/libvirt,zippy2/libvirt,olafhering/libvirt,nertpinx/libvirt,andreabolognani/libvirt,agx/libvirt,taget/libvirt,jfehlig/libvirt,zippy2/libvirt,andreabolognani/libvirt,crobinso/libvirt,VenkatDatta/libvirt,libvirt/libvirt,eskultety/libvirt,taget/libvirt,eskultety/libvirt,agx/libvirt,rlaager/libvirt