qemu: cleanup error checking on agent replies
qemu: cleanup error checking on agent replies

On all the places where qemuAgentComand() was called, we did a check
for errors in the reply.  Unfortunately, some of the places called
qemuAgentCheckError() without checking for non-null reply which might
have resulted in a crash.

So this patch makes the error-checking part of qemuAgentCommand()
itself, which:

 a) makes it look better,

 b) makes the check mandatory and, most importantly,

 c) checks for the errors if and only if it is appropriate.

This actually fixes a potential crashers when qemuAgentComand()
returned 0, but reply was NULL.  Having said that, it *should* fix the
following bug:

https://bugzilla.redhat.com/show_bug.cgi?id=1058149

Signed-off-by: Martin Kletzander <e82f23e74d43760279ebcc505dac4ae70d5627d0@redhat.com>

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