Edit existing profile polyline instead of creating a new one.

Edit existing profile polyline instead of creating a new one when the earth curvature is toggled.

Fixes the polyline not disappearing when the window is closed.