Add HashSet::with_capacity_and_keys() function

This function can be use to create HashSets before the tls is
initialized.
Convert rust_crate_map.cpp to Rust

Conflicts:
	src/libstd/rt/logging.rs
auto merge of #9087 : fhahn/rust/rust_crate_map, r=brson

This patch converts the rust_crate_map.cpp to Rust as mentioned at the end of #8880.