Change range_check before mrb_obj_alloc.
Merge pull request #2282 from yui-knk/check-before-malloc

Change range_check before mrb_obj_alloc.