implemented buf_takeStart() and buf_takeFinish() - for direct access to the buffer / less copying
fixed potential bug in _buf_get_space()
fixed realloc() in _buf_get_space()