Fix to work with the new str api.

as_c_str occurences have been replaced by to_c_str().unwrap().