Fix segfualts on FFI::Pointer#read/write methods