Call QSqlQuery::finish() on all SELECT queries when done
It's what documentation says should be done, and once Qt is fixed it
will also cause the QSqlQuery to free the underlying DBMS' results,
so that keeping the query around in the caches won't cause them to
use insane amount of memory, if the last query happened to return a
lot of results.
(cherry picked from commit 089ee6959fcdbe7d94ce0227c3348f1ecc70053d)