[sql] Fix crash in sqlite3_total_changes.
The mmap support makes direct SQLite calls against the database handle
in ReleaseCacheMemoryIfNeeded() (called after transactions are closed or
statements are executed outside of any explicit transaction). Recovery
or raze during the error callback can close this handle during
otherwise-valid sequences of calls. Check that the handle is still open
before clearing the cache.
BUG=589986
Review URL: https://codereview.chromium.org/1741553002
Cr-Commit-Position: refs/heads/master@{#377924}
2 files changed