reset the skip value when the buffer is empty after skipping

When skipping content at the beginning of the buffer, we simply increase the
skip value. However if we skipped the whole content of the buffer, we now have
an empty buffer with a skip value greater than zero. Since skipped space does
not count as free, various functions will allocate more memory even though it
is not necessary.

We simply reset the skip value if the buffer is empty after skipping.

Without this patch, buffers can grow continuously. This is easy to reproduce
when using a buffer to read data. Content is skipped after being parsed, but
bf_buffer_read() will allocate more memory because of the non-zero skip value.

We also export two functions, bf_buffer_free_space() and bf_buffer_size()
which are useful for tests and to diagnose this kind of problem.