fix #36256: layout shift due to courtesy elements

My changes to the cautionary width calculations appear to yield the correct results to within a fraction of a spatium.  See issue discussion for an explanation of why i removed the assignment of hasCourtesy = false within the key signature loop.