QtHelp: Report failures when copying the collection file
copyCollectionFile() ignored the results of the statements copying the
data into the new collection file and returned true even when they
failed. When creating the tables failed, it left the new file and its
database connection behind.
Copy the data in a transaction, check the results of the statements and
of the commit, and remove the incomplete file on failure. Close the
connection before removing it, which also fixes the warning that the
connection is still in use.
Task-number: QTBUG-150686
Pick-to: 6.12 6.8
Change-Id: I5032166c38c3f12b27b4a7002f01d1a012a855a6
Reviewed-by: Kai Köhne <kai.koehne@qt.io>