e4325a6858Make it possible to sqlite-finalize the same statement twice.
* sqlite3.scm.in (sqlite-finalize): Make it possible to finalize twice.
* tests/basic.scm: Add test for finalizing the same statement twice.
c59db66f9aReset statement when sqlite-finalize is called on cached statement
Automatically-started transactions only end when a statement finishes, which is
normally either when sqlite-reset or sqlite-finalize is called for that
statement. Consequently, transactions automatically started by cached
statements won't end until the statement is next reused by sqlite-prepare or
sqlite-reset is called on it. This changes sqlite-finalize so that it preserves
the statement-finishing (and thus transaction-finishing) behavior of