Use StringValuePtr rather than obsolete STR2CSTR for Ruby 1.9

One more patch to compatible with Ruby 1.8/1.9.