Fix memory corruption that can occur during a Ruby GC run.
Merge pull request #1 from ice799/fix_memory_corruption

Fix memory corruption that can occur during a Ruby GC run.