Fix #25165 - crash when changing rest measure duration to or from irregular time.

When the actual duration of a measure is changed and either the starting or ending duration cannot be represented with a simple value (for instance 5/4) and the measure contains a single whole measure rest, a division by 0 results. See http://musescore.org/en/node/25165 for examples, discussion and analysis.

Fixed.

If the new measure value is different from the current time sig, rest(s) to represent the actual measure values are used instead of whole measure rests.
Tick where to place the newly added rests was wrong.
Merge pull request #809 from mgavioli/fix_25165_pickup_meas_with_irreg_metre_measure_rest_crashes

Fix #25165 - crash when changing measure with whole measure rest