[buffer] Use destructor to clean up allocated data

Macro V4_NEEDS_DESTROY adds a default destroy() implementation, which
calls a destructor of a Heap-object.