Fix error handling for mrb_open_allocf().

When DISABLE_GEMS is not defined and
a return value of mrb_open_core() is NULL,
mrb_open_allocf() may cause SEGV.
Merge pull request #2543 from cubicdaiya/issues/mrb_open_allocf_error_handlings

Fix error handling for mrb_open_allocf().