Save line (rebased onto develop)



This is the same as gh-2616 but rebased onto develop.

----

Problem found while debugging the delete ROI error:

To test the PR:
 * Draw a line and Save
 * Turn the line into a Polyline and Save. No error message displayed.
 * Propagate the shape and Save
 * Go to one plane, remove the shape. Go to another plane and delete the shape. Save
 * Check that the roi is correctly saved.