Do not write beyond the bounds of the buffer.

When buffer->data != buffer->start, the region after pbuffer_end(buffer)
only counts for a part of the pbuffer_unused. In that case, the memset
would write cause an out-of-bounds write.
Revert "Do not write beyond the bounds of the buffer."

This reverts commit 7ad7612085467544a65fa5f6e7183eb61e2e7b65.
Make pbuffer_unused give length of portion after data

Previously, pbuffer_unused erroneously gave back the size of the
allocated data that was not contained in buffer->data. After confering
with the original author, it became apparent that the pbuffer_unused
should refer to the length of the portion after the data up to the end
of the allocated area.
Merge pull request #3 from sjoerdjob/pbuffer_grow_clear_out_of_bounds

Do not write beyond the bounds of the buffer.