Add workaround for issues with cross-staff beams
There is a circular property callback dependency between Stems' and Beams' directions. This circular dependency occurs when a cross-staff Stem that needs to be beamed coincides with both a LedgerLine and a DynamicText.
It is hard to identify the logical error, but one candidate may be when the Beam method consider_auto_kees calls pure_y_relative_coordinates. This call results in an attempt to gather information about all of the grobs in the VerticalAxisGroup containing the Beam (including the Beam's direction).
The regression was triggered by 09412c25, in which DynamicText grobs were updated to align themselves horizontally to their X parent (aligned_on_x_parent). This causes the calculation of the extents of the relevant Paper/NoteColum, which triggers many other calculations.
Work around the problem by trying to detect when a DynamicText is aligned with cross-staff stems, and change the horizontal alignment to x_aligned_on_self, which does not trigger the same calculations.
Add a regtest to cover all of the relevant issues: 4182, 4691 and 6004.