Fix error handling for mrb_generate_code().

The return value of `mrb_generate_code()`
must be null-checked before referencing.