Port GC alloc profiler + heap snapshot to C (#61401)
As part of the effort to remove more dependencies on LLVM / C++ in
`libjulia-internal`, this rewrites the GC alloc profiler + heap snapshot
to be implemented in C.
Also fixes a heap snapshot bug with `next_snapshot_id` along the way.
---------
Co-authored-by: Claude <noreply@anthropic.com>