rustc: Encode the visibility of foreign items

The privacy pass of the compiler was previously not taking into account the
privacy of foreign items, or bindings to external functions. This commit fixes
this oversight by encoding the visibility of foreign items into the metadata for
each crate.

Any code relying on this will start to fail to  compile and the bindings must be
marked with `pub` to indicate that they can be used externally.

Closes #16725
[breaking-change]
auto merge of #16740 : alexcrichton/rust/issue-16725, r=pcwalton

Closes #16725