[PATCH 6.5 064/739] libbpf: only reset sec_def handler when necessary