virdomainjob: virDomainObjInitJob: Avoid borrowing memory from 'virDomainXMLOption'
virdomainjob: virDomainObjInitJob: Avoid borrowing memory from 'virDomainXMLOption'

The 'cb' and 'jobDataPrivateCb' pointers are stored in the job object
but made point to the memory owned by the virDomainXMLOption struct in
the callers.

Since the 'virdomainjob' module isn't in control the lifetime of the
virDomainXMLOption, which in some cases is freed before the domain job
data, freed memory would be dereferenced in some cases.

Copy the structs from virDomainXMLOption to ensure the lifetime. This is
possible since the callback functions are immutable.

Fixes: 84e9fd068ccad6e19e037cd6680df437617e2de5
Signed-off-by: Peter Krempa <2cf5c04c61aa466e4a47bfedc747d17279c72ffc@redhat.com>
Reviewed-by: Martin Kletzander <e82f23e74d43760279ebcc505dac4ae70d5627d0@redhat.com>

olafhering/libvirt,jfehlig/libvirt,zippy2/libvirt,libvirt/libvirt,jfehlig/libvirt,olafhering/libvirt,olafhering/libvirt,libvirt/libvirt,jfehlig/libvirt,olafhering/libvirt,zippy2/libvirt,libvirt/libvirt,jfehlig/libvirt,zippy2/libvirt,zippy2/libvirt,libvirt/libvirt