perf: Fix context leak in put_event()