Avoid consecutive identical nodes when adding a midpoint

Previously, adding a midpoint to an invalidly doubled-back
segment (aba) resulted in a self-intersection with an invalid
consecutive node (accba). Now a self-intersection is still
produced, but with only one c node (acba).

Refs #1296