Allow linking against crates with #[no_std]

Previously having optional lang_items caused an assertion failure at
compile-time, and then once that was fixed there was a segfault at runtime of
using a NULL crate-map (crates with no_std)
auto merge of #7924 : alexcrichton/rust/opt-lang-xcrate2, r=thestinger

This is a reopening of #7874