fix #24350: markings lost after timesig change

Annotations were completely lost, spanners placed incorrectly.  Also,
repeat measure symbol caused hang.  These are fixed.  Key signatures
still can get messed up, at least until reload.  And barline styles are still 
lost even when they coincide.  But things are much better than before.