perf: Ensure we call add_event_to_ctx() with the right locks held