Fix memory leaks in Kruskal-Wallis test