bpf: Refactor BPF_PSEUDO_CALL checking as a helper function