Remove to_unsafe_ptr usage (mozilla/rust#12282).