v1 was here:
https://www.redhat.com/archives/libguestfs/2019-September/msg00100.html
In v2 I've changed the patch so it avoids calling realloc at all in
this case.
The patch is a bit longer this way. But I don't see any other
alternative if we are to avoid having a "realloc wrapper" of some kind
that we use everywhere, which I guess we should avoid because it makes
plugins just that bit harder to write and we want them to be as easy
to write and accessible as possible.
Also:
- Clean up the commit message.
- Add a simple regression test.
Rich.