Consistency of Lloyd's Algorithm Under Perturbations