Fix error handlings for mrb_open_core().
Merge pull request #2544 from cubicdaiya/issues/mrb_open_core_error_handling

Fix error handlings for mrb_open_core().