Commit b3f2b4ca left buf unallocated in the case of QMP capability probing being used, leading to a segfault in strlen in the cleanup path. This patch opens the log and allocates the buffer if QMP probing was used, so we can display the helpful error message.