apic: Resolve potential endless loop around apic_update_irq