Fix closed rings generated by clipping.

After intersecting a polygon with a clip region, it's possible for one
or more of the resulting visible segments to be a closed ring.  This
occurs when the first and last points in a segment are coincident (or
close enough to be coincident).

If the clipping algorithm attempts to rejoin these segments, first it
orders intersection points along the clip edge, and the subsequent
interpolation direction depends on this order.  However, the order of
coincident points is ambiguous, hence “flickering” may occur if the
order of two coincident swaps around, causing interpolation to alternate
between taking the longer and shorter ways around the clip edge.

See #1095.