Fixes for compatibility with Rust master

Changes:

* `extern mod` is now `extern crate` (mozilla/rust#12017)
* `std::ptr::to_unsafe_ptr` has been removed (mozilla/rust#12282)