Fixes use-after-free issue in mimedb.cpp

Calling writer() might fail in which case launch_buff gets freed.

In detail: the realloc in writer() might return null, in which case the launch_buff gets freed and an error is set appropriately. But on the call site launch_buf was still passed to system().

So either we set launch_buff to null or avoid the invalid memory access.

This patch prevents the subsequent use of memory after it was freed.