std: Move mem to libprim
std: Stop (incorrectly) parameterizing some memcpy functions over RawPtr

This couples ptr and cast in a way that makes it harder to extract these modules.
It also is arguably incorrect since it makes unsafe assumptions that any impl
of RawPtr is for actual pointers.