fix #24350: markings lost after timesig change

Annotations were completely lost, spanners placed incorrectly.  Also, repeat measure symbol caused hang, repeat barlines were lost even when they coincide and could have been preserved.  These issues are fixed.  Key signatures still can get messed up, at least until reload.  But things are much better than before.