refactor without (direct) dynamic allocation

fix the issue http://github.com/antirez/lua-cmsgpack/issues/13