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.
Copy the buffer instead of assigning buffer.
Switched to tag parse testing

[conf]
- parse output channel correctly

[forward]
- only set poll events when there is a channel
- added extra debugging

[tlv]
- added extra debugging

[portall.conf]
- switched to tag parse testing
Merge branch 'master' of https://github.com/blikjeham/portall

Conflicts:
	tlv.c
Merge pull request #3 from sjoerdjob/pbuffer_grow_clear_out_of_bounds

Do not write beyond the bounds of the buffer.
Fixed pointer to data after debugging

[logging]
- fixed pointer to data after debugging

[forward, tlv]
- removed extra debugging

[pbuffer]
- added debugging functions