mruby: fix a bug that flags isn't copied
mruby: fixed a bug next_data isn't removed