[libvirt] [PATCHv2] event: fix two event-handling bugs