buffer.hpp: more != NULL checks and tests
buffer_tests.hpp: add tests for insertion and extraction

Use common/libevent.h's IghtEvbuffer, so we don't need to care
about freeing resources when we leave the context.
buffer_tests.hpp: use IghtEvbuffer rather than evbuffer

This way, resources are automatically cleanup up when we leave
the current context, and we avoid leaks.