librustc: Enforce privacy for static methods.

This starts moving a bunch of privacy checks into the privacy
checking phase and out of resolve.
libsyntax: Accept `static` instead of `const` for globals
auto merge of #5438 : pcwalton/rust/static-globals, r=graydon

r? @graydon