Refactoring write barrier for copying generic memory, but moving it from `genericmemory.c` (#57252)
This PR moves stock-specific write barriers from
`jl_genericmemory_copyto` into `julia.h`. Note that this PR can be
merged independently, but is heavily connected with
https://github.com/JuliaLang/julia/pull/57237. Ideally they should be
combined, but this PR actually introduces new functions to the GC
interface, and that is the main reason I'd like them to be reviewed
separately. The code for either PR will have to be adapted depending on
which one gets merged first.