[PATCH 4.14 100/105] x86/apic: Move pending interrupt check code into its own function