QSqlDatabase with ODBC crashed on close

QODBC crashes when closing a database with an QSqlQuery attached.

Make sure all QSqlQuery’s are out of scope before closing or destroying the database.