[ruby] Fix shorten-64-to-32 errors on macOS

Since the extconf.rb pass `-Werror`, the gem won't compile.
diff --git a/lib/rb/ext/memory_buffer.c b/lib/rb/ext/memory_buffer.c
index 8b52c4a..96604af 100644
--- a/lib/rb/ext/memory_buffer.c
+++ b/lib/rb/ext/memory_buffer.c
@@ -54,7 +54,7 @@
   
   index += length;
   if (index > RSTRING_LEN(buf)) {
-    index = RSTRING_LEN(buf);
+    index = (int)RSTRING_LEN(buf);
   }
   if (index >= GARBAGE_BUFFER_SIZE) {
     rb_ivar_set(self, buf_ivar_id, rb_funcall(buf, slice_method_id, 2, INT2FIX(index), INT2FIX(RSTRING_LEN(buf) - 1)));