implemented writing access to buffers

* separated bit operations in a new module (bit_util)
* added endianness convertion support
* refactored bit access macros
remove entry from masks table on lbuf_gc() call
Implement buffer reference counter using a Lua table
Fix a wrong replacement made in the last commit
Fix flags in printf() calls inside buf_nref_{inc,dec}()
Merge branch 'gc' of https://github.com/lneto/lbuf into gc