avoid deprecated rb_thread_blocking_region in Ruby 2.0/2.1