Changing ROI mode while having an incomplete ROI leads to an exception
To reproduce, use `examples/plotInteractiveImageROI.py`, select polygon ROI mode, start creating a polygon with a few points, then while the polygon is not closed, select the rectangle ROI mode.
This leads to:

```
Traceback (most recent call last):
  File "silx/gui/plot/tools/roi.py", line 294, in _plotInteractiveModeChanged
    self.__roiInteractiveModeEnded()
  File "silx/gui/plot/tools/roi.py", line 669, in __roiInteractiveModeEnded
    self.removeRoi(self._drawnROI)
  File "silx/gui/plot/tools/roi.py", line 551, in removeRoi
    self._restart()
  File "silx/gui/plot/tools/roi.py", line 646, in _restart
    firstInteractionShapeKind = roiClass.getFirstInteractionShape()
AttributeError: 'NoneType' object has no attribute 'getFirstInteractionShape'

```
diff --git a/silx/gui/plot/tools/roi.py b/silx/gui/plot/tools/roi.py
index 431ecb222..5906bc2b5 100644
--- a/silx/gui/plot/tools/roi.py
+++ b/silx/gui/plot/tools/roi.py
@@ -666,8 +666,9 @@ class RegionOfInterestManager(qt.QObject):
 
             if self._drawnROI is not None:
                 # Cancel ROI create
-                self.removeRoi(self._drawnROI)
+                roi = self._drawnROI
                 self._drawnROI = None
+                self.removeRoi(roi)
 
             plot = self.parent()
             if plot is not None:
['silx/gui/plot/tools/roi.py']