Correctly choosing the end segment when selecting only one or the last m...

...easure

When a single measure is selected by clicking it, the endSegment of the selection is now set to the next segment after the selection (as what is done in all other cases)

When selecting the last measure the endSegment is set to 0 to add consistency. This is what is done if you drag-select the last measure.