qga: process_event() simplification and leak fix