Try to create a buffer big enough for the query to fit in.

This way Mmsg doesn't have to reallocate the buffer trying to fit the
whole query into the query buffer.