Make `String(::Memory)` copy (#54457)
A more targeted fix of #54369 than #54372
Preserves the performance improvements added in #53962 by creating a new
internal `_unsafe_takestring!(v::Memory{UInt8})` function that does what
`String(::Memory{UInt8})` used to do.