rt: Add RUST_DEBUG_MEM to rust_env to avoid races

Fixes #5341