fix: ensure that memory is free'd using the same allocator (#4101)
We were encountering segfaults on certain combinations of go / rust
versions. This was determined to be due to differing allocators. Memory
reserved on one side of the sandwich and free'd on the other would
sometimes fail depending on toolchains / platform. This resolves that
problem.
To complicate things, this issue would only arise during
cross-compilation, and not when building on the target OS / arch, as the
allocator would presumably be the same.
### Testing Instructions
I am going to run a dry run canary that we can re-test, though I have
manualy verified the cross-compilation for win amd64.