[PATCH 4.9 60/65] x86/apic: Move pending interrupt check code into its own function