Update to the new Rust api and syntax.

`priv` is forbidden when it does not have any effect.
`as_c_str` is replaced by `to_c_str().unwrap()`. This might leack the c sting though.