test/ring_perf: fix memory leak