Handle SQLite Commit Failure

This PR ensures that if `COMMIT/BEGIN TRANSACTION` fails, we do the right thing