[libvirt] [PATCH python] Optimize callback lookup in event handlers