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

Not that it really matters with the current cgimap API calls because m_first_query is never true on calls that don't put initial data into tables, but it seems odd to set the flag on queries that we know won't add any data to the tmp_tables.