Add type checks and GC guards before accessing the query options hash in the result object. See #321.
Merge pull request #346 from sodabrew/gc_guard_hash_dup

Per #321 use RB_GC_GUARD around rb_hash_dup