fix #40581: overlapping ledger lines between voices

My fix aims for a balance betwene efficiency and effectiveness.  In determining if there is a conflict with a previous note, I always prefer a note in the same voice if there is one in the previous segment.  Only if there isn't do I look in other voices.  I tried variations where I always hunted for chord with ledger lines in any voice, but there would still be corner cases that were missed, so I went with the simple version.