snapshot: Improve logic of virDomainMomentMoveChildren
snapshot: Improve logic of virDomainMomentMoveChildren

Even though Coverity can prove that 'last' is always set if the prior
loop executed, gcc 8.0.1 cannot:

  CC       conf/libvirt_conf_la-virdomainmomentobjlist.lo
../../src/conf/virdomainmomentobjlist.c: In function 'virDomainMomentMoveChildren':
../../src/conf/virdomainmomentobjlist.c:178:19: error: 'last' may be used uninitialized in this function [-Werror=maybe-uninitialized]
         last->sibling = to->first_child;
         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~

Rewrite the loop to a form that should be easier for static analysis
to work with.

Fixes: ced0898f86bf
Reported-by: Bjoern Walk <40545c009452f40d2ae0bbfbd987b332d274d328@linux.ibm.com>
Signed-off-by: Eric Blake <a9da18479c871fe903d9590822cfe2629c6a4d11@redhat.com>
Reviewed-by: Ján Tomko <4cab11cfb98d3c937327354a78eb07dbb6ee2bc6@redhat.com>

olafhering/libvirt,libvirt/libvirt,libvirt/libvirt,eskultety/libvirt,jardasgit/libvirt,andreabolognani/libvirt,jardasgit/libvirt,andreabolognani/libvirt,nertpinx/libvirt,andreabolognani/libvirt,crobinso/libvirt,libvirt/libvirt,nertpinx/libvirt,eskultety/libvirt,eskultety/libvirt,crobinso/libvirt,andreabolognani/libvirt,jfehlig/libvirt,jfehlig/libvirt,jardasgit/libvirt,fabianfreyer/libvirt,eskultety/libvirt,nertpinx/libvirt,jardasgit/libvirt,nertpinx/libvirt,fabianfreyer/libvirt,olafhering/libvirt,jardasgit/libvirt,fabianfreyer/libvirt,jfehlig/libvirt,crobinso/libvirt,zippy2/libvirt,zippy2/libvirt,crobinso/libvirt,andreabolognani/libvirt,nertpinx/libvirt,fabianfreyer/libvirt,olafhering/libvirt,eskultety/libvirt,zippy2/libvirt,libvirt/libvirt,jfehlig/libvirt,fabianfreyer/libvirt,zippy2/libvirt,olafhering/libvirt