Sketcher: fix polyline closing when coincident points are involved