tsan: fix memory leak