storage: fix crash caused by no check return before set close
storage: fix crash caused by no check return before set close

https://bugzilla.redhat.com/show_bug.cgi?id=1087104#c5

When trying to use an invalid offset to virStorageVolUpload(), libvirt
fails in virFDStreamOpenFileInternal(), although it seems libvirt does
not check the return in storageVolUpload(), and calls
virFDStreamSetInternalCloseCb() right after.  But stream doesn't have a
privateData (is NULL) yet, and the daemon crashes then.

0  0x00007f09429a9c10 in pthread_mutex_lock () from /lib64/libpthread.so.0
1  0x00007f094514dbf5 in virMutexLock (m=<optimized out>) at util/virthread.c:88
2  0x00007f09451cb211 in virFDStreamSetInternalCloseCb at fdstream.c:795
3  0x00007f092ff2c9eb in storageVolUpload at storage/storage_driver.c:2098
4  0x00007f09451f46e0 in virStorageVolUpload at libvirt.c:14000
5  0x00007f0945c78fa1 in remoteDispatchStorageVolUpload at remote_dispatch.h:14339
6  remoteDispatchStorageVolUploadHelper at remote_dispatch.h:14309
7  0x00007f094524a192 in virNetServerProgramDispatchCall at rpc/virnetserverprogram.c:437

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

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