[transfer-engine] Fix QSqlDatabase leak.

We need to remove the database from the list of connections in order to really close
the database and cleanup any temporary files left.