Convert rust_crate_map.cpp to Rust
Add HashSet::with_capacity_and_keys() function

This function can be use to create HashSets before the tls is
initialized.