Add API `mrb_atexit()`.

Functions registered with `mrb_atexit` will be called in `mrb_close`.
`mrb_final_mrbgems` will be called as `mrb_state` **at exit** function. (So it'll be `static` function.)
Maybe useful in #1844.