Fixed list indexing in closed spline curve

The closed spline was broken since the automatic growing of lists is no more possible in dart. This copies the fix that was applied in the open spline.