If upgrade from read to write transaction fails, don't roll back the transaction. Instead restore the transaction into its original state, which allows deferred transactions that have not read anything to restart automatically. Fixes #2984
turso_assert