rewrite the ffi tutorial with snappy as an example

The example with OpenSSL is incorrect, because OpenSSL is using a
static variable for the return value and isn't thread-safe.

The gettimeofday example is specific to POSIX systems so it's not ideal.