Fix a crash after removing a vector layer with active selection of shapes
Steps to reproduce:
- set undo limit to 10 steps;
- add a vector layer;
- add a lot of shapes/text to that;
- select some of these shapes
- remove the vector layer;
- do 10 brush strokes to make sure the vector layer is pushed out of the history;
The problem happened in the following way:
- On destruction of the layer, KoSelection::deselect() was called
- This deselect() call triggered a start of the QTimer
- The timer itself was destroyed in the non-gui thread (in an active state), as was warned by Qt
- The timer event was delivered to the destroyed timer, which caused a crash.