fix #32826: end repeat on mmrest

According to my understanding after talking with @mgavioli, this code should be good.  endBarLineGenerated is normally true except double bars, dotted bars, etc.  End repeats do *not* necessarily set endBarLineGenerated to false because in fact they *can* generated from the repeatFlags.  So we need to check for the appropriate repeatFlag on the last measure.

I also changed the code here that sets the repeatFlag for the mmrest itself.  It was originally only using the last measure's repeat flags, then this was changed back in July to use only the first  measure's repeat flags - and the line to set those flags was duplicated, so it was being set twice.  I believe it makes sense for the mmrest to share the repeat flags of both the first & last measure, but I am less sure this is actually necessary or that there aren't reasons why it shouldn't.  But I've tested and seems things still work - including the case of the "phantom courtesy start repeat" at the end of a system before a system that begins with a start repeat.  These cases were fixed by @mgavioli already, and my change here does not appear to adversely affect that.