BUG: capture infinite loops creating LinearRings

Using current implementation, a multilinestring is used to construct
linestrings which include boundary points in order to make suitable
LinearRings, however, this can result in infinite loops as points are
determined by distance measures.

This fix maintains a list of linestring indices, ensuring that no
linestring can be re-added.