tracing: fix memory leak in trace_stat