fix #18963 dragging timesig cause crash

I tried to tackle with this bug, but I have a doubt:
- in rev. https://github.com/musescore/MuseScore/commit/b4e0f7b Werner deleted lines 502:504, i.e.  duration -= d;   rest     -= d;   pos      += d;
I re-added these lines in the first commit of this pull request because they were causing an infinite loop which was preventing further processing of the file.
The second commit deals with the actual bug, i.e. the fact that the last MeasureBase element is not a mesure, but a VBox.
By re-adding the lines with the first commit that had been deleted, at the moment I do not see strange behavior: can they be safely left?

Additional note: there is still a bug which is only slightly related to this score if the timesig-change changes the parent system of the VBox:
http://musescore.org/en/node/20120
But that is a different bug.