qemu: fix msg could be a wild pointer in qemuMonitorIOProcess()
qemu: fix msg could be a wild pointer in qemuMonitorIOProcess()

As qemuMonitorJSONIOProcess will call qemuMonitorJSONIOProcessEvent
which unlocks the monitor mutex, there is some extreme situation,
eg qemu send message to monitor twice in a short time, where the
local viriable 'msg' of qemuMonitorIOProcess could be a wild point:

1. qemuMonitorSend() assign mon->msg to parameter 'msg', which is alse a
local variable of its caller qemuMonitorJSONCommandWithFd(), cause
eventloop to send message to monitor, then wait condition.
2. qemu send message to monitor for the first time immediately.
3. qemuMonitorIOProcess() is called, then wake up the qemuMonitorSend()
thread, but the qemuMonitorSend() thread stuck for a while as cpu pressure
or some other reasons, which means the qemu monitor is still unlocked.
4. qemu send event message to monitor for the second time,
such as RTC_CHANGE event
5. qemuMonitorIOProcess() is called again, the local viriable 'msg' is
assigned to mon->msg.
6. qemuMonitorIOProcess() call qemuMonitorJSONIOProcess() to deal with
the qemu event.
7. qemuMonitorJSONIOProcess() unlock the qemu monitor in the macro
'QEMU_MONITOR_CALLBACK', then qemuMonitorSend() thread get the mutex
and free the mon->msg, assign mon->msg to NULL.

Signed-off-by: Weilun Zhu <104401be6ca56130f9d70e0eb1347b9b1fa64235@huawei.com>
Reviewed-by: Jiri Denemark <62bdf77dc47919a4d59a91822129d14633cfca81@redhat.com>

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