Only set m_first_query on queries that could put initial data in the tables

Not that it really matters with the current API, but it seems odd to set the flag on queries that we know won't add any data to the tmp_tables.