rm some uses of to_mut_unsafe_ptr
auto merge of #7016 : thestinger/rust/ptr, r=luqmana