Remove use of define_singleton_method.
On overflow, clear new stack space before mrb_raise
Merge pull request #2166 from take-cheeze/fix_for_1_8

Remove use of define_singleton_method.
Merge pull request #2168 from carsonmcdonald/stackclearfix

On overflow, clear new stack space before mrb_raise