Correctly encode item visibility in metadata

This fixes private statics and functions from being usable cross-crates
auto merge of #8365 : alexcrichton/rust/correct-item-visibility, r=pcwalton

This fixes private statics and functions from being usable cross-crates.

This addresses some concerns about statics being public by default by accident from #8122