Remove duplicate positions from polylines.

For #898.
Err, this is some of the earlier code I wrote in Cesium.  I suppose we should `clone` now, right?