Fix layout of ambitus elements with accidentals.

Ambitus elements with accidental(s) are laid out misaligned with ambitus elements without accidental(s).

The new algorithm aligns the leftmost note heads of each ambitus and places accidentals accordingly.
Clean up code and correct octave detection in updateRange()
Fixes to ambitus:

- Fix missing adjustReadPos() for ambitus in Maesure::layoutX()

- Reduce left margin in there are accidentals
fix #25340
fix #4487
fixing an off-by-one error

which for some reason hasn't caused any damage, but should get fixed
anyhow
Merge pull request #827 from Jojo-Schmitz/plugins

fixing an off-by-one error
Merge pull request #824 from mgavioli/fix_ambitus_layout

Fix ambitus layout