If the underlying database has been closed, then sqlite3_errcode() returns an "out of memory" error. Sigh. So, we provide a sensible error code in this case.