- Change `rust_str_to_c_str` and `rust_bytes_to_c_str_lossy` to
return a `Result`.
- Return `Error::OutOfMemory` if `malloc` fails instead of undefined
behavior.
- Update the callers to propagate the error when convenient and to
panic explicitly when not.
- Note: Rust panics if a memory allocation fails so we don't go
too far out of the way to propagate memory allocation errors.