improve hd2str_lua()

Import ichizok's patch:
https://gist.github.com/ichizok/b34b2566ba526116b64a

Use table.insert() and table.concat() instead of concatenating each
byte one by one.