buffer: only realloc on destroy if data is allocated.