Make QEMUFile buf expandable, and introduce qemu_realloc_buffer() and qemu_clear_buffer().

Currently buf size is fixed at 32KB.  It would be useful if it could
be flexible.