Added undo for polygon and polyline

Press Ctrl+z while adding polygons or polylines to undo currently added vertexes.