Changes:
* uses Rust edition 2018
* returns wasm32 errno directly rather than relying on
wasi_common::{host, memory} modules
* wraps extraction of memory and WASI context in a macro
While the "__wasi_memory" name is something we considered, the name
currently being used for the memory exported to WASI is "memory", so
adjust the error message accordingly.
In more detail, this commit:
* makes fd_prestat_get safe
* rewrites fd_prestats_get_entry in (safe) Rust
* creates helper macros for rwlock read lock and unlock
Avoid needlessly copying data from wasm into the host for output
parameters, and factor out the `.unwrap()` for translating pointers
when writing to output parameters.