Forbid extern statics from appearing in patterns

Fixes #16149.
auto merge of #16567 : jakub-/rust/issue-16149, r=pcwalton

Fixes #16149.