qemu: fix double free when RNG cold-plug fails
qemu: fix double free when RNG cold-plug fails

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

When cold-plugging an RNG device but something fails in
qemuDomainAssignAddresses, we will double free the RNG device.
Once a device is plugged into the domain, we should set the
device pointer to NULL to fix this issue.

...
5  0x00007fb7d180ac8a in virFree at util/viralloc.c:582
6  0x00007fb7d1895cdd in virDomainRNGDefFree at conf/domain_conf.c:19786
7  0x00007fb7d1895d99 in virDomainDeviceDefFree at conf/domain_conf.c:2022
8  0x00007fb7b92b8baf in qemuDomainAttachDeviceFlags at qemu/qemu_driver.c:8785
9  0x00007fb7d190c5d7 in virDomainAttachDeviceFlags at libvirt-domain.c:8488
10 0x00007fb7d23af9d2 in remoteDispatchDomainAttachDeviceFlags at remote_dispatch.h:2842
...

Signed-off-by: Luyao Huang <23d9981432efa88691fd2a71f5525bc2174f7664@redhat.com>

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