coverity/74717: FP: NULL Pointer Dereference

dynamic_buffer_ensure() allocates buf->data; add an assert to make this
clear to coverity.
Merge pull request #1684 from justinmk/coverity74717

[RFC] coverity/74717: FP: NULL Pointer Dereference