rustc: remove some unnecessary `transmute`s.

These can all be done by implicit or explicit &T -> *T casts, which are
more restricted and so are safer.
auto merge of #12394 : huonw/rust/transmute--, r=pnkfelix

These can all be done by implicit or explicit &T -> *T casts, which are
more restricted and so are safer.
move extra::test to libtest