Convergence of the thresholding scheme for multi-phase mean-curvature flow