fix warning: ensure to check unused variable
fix warning: ISO C90 forbids mixed declarations and code
fix deprecation warning: migrate rb_thread_blocking_region to rb_thread_call_without_gvl
fix some warnings with Ruby 1.8