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

Fixes #14845.
Currently, we allow `&mut T` to `*mut T` but not `&mut [T]` to `*mut T`. This change just disallows something like `&[T]` to `*mut T`.