Fix some memory leaks in HierarchicalClusteringIndex