Fix the ordering of `unsafe` and `extern` in methods

This breaks code that looks like this:

    trait Foo {
        extern "C" unsafe fn foo();
    }

    impl Foo for Bar {
        extern "C" unsafe fn foo() { ... }
    }

Change such code to look like this:

    trait Foo {
        unsafe extern "C" fn foo();
    }

    impl Foo for Bar {
        unsafe extern "C" fn foo() { ... }
    }

Fixes #19398.

[breaking-change]
auto merge of #19418 : P1start/rust/unsafe-extern-trait, r=alexcrichton

Fixes #19398.