librustc: Take in account mutability when casting array to raw ptr.

Fixes #14845.
Hmm, do we not intend to support `&mut T` to `*mut T`? I kind of assumed we did, though I can see an argument for not doing so, since the semantics are not compatible.