perf: Avoid undefined behavior from stopping/starting inactive events (CVE-2025-39821) | HOL Guard CVE