tests: fix memory leak in tests launcher