SQLite3: Rollback only if in a transaction.

As the driver may rollback a statement or a transaction on error, the
caller must check the state of the transaction
(http://www.sqlite.org/lang_transaction.html).

Fixes: #13638