use rb_thread_call_without_gvl instead of rb_thread_blockin_region, because of it's obsoleted in Ruby 2.2.0
extracted duplicated code
Merge pull request #197 from hsbt/support-ruby-2.2.0

Support to Ruby 2.2.0