libbpf: Fix potential NULL pointer dereference