Fix [perl #66970] Incorrect coderef in MODIFY_CODE_ATTRIBUTES
Attribute handlers being applied to a temporary CV has actually been
reported as a bug, #66970. The attached patch fixes the bug, by
changing the order in which things happen: attributes are now applied
after the temporary CV has been merged into the existing CV or has
otherwise been added to the appropriate GV.
The change breaks part of Attribute::Handlers. Part of A:H searches the
package to find the name of the sub to which a :ATTR attribute is being
applied, and the correct time at which to launch that search depends
crucially on the order in which the CV construction events occur. So
this patch also includes a change to A:H, to make it detect which way
things happen. The resulting A:H works either way, which is essential
for its dual-life nature.