fix compile error under newest rust

* cast::transmute => mem::transmute
* remove slice::raw::from_buf_raw
* ...