kvm: x86: fix kvm_apic_has_events to check for NULL pointer