allocate `history_path` dynamically

`PATH_MAX` doesn't have to be defined and if it is, then its value is
usually incorrect (possible buffer overflow).
Use `malloc` and `snprintf` instead to prevent this.

https://www.gnu.org/software/hurd/community/gsoc/project_ideas/maxpath.html
call `mrb_malloc_simple` instead of `malloc`
Merge pull request #2462 from cremno/mirb-malloc-history_path

mirb: allocate `history_path` dynamically