Fix the sqlite3_db_readonly() API so that it reports true if the database
is readonly because the file format write version (byte 18 of the header)
is too large.
Do not burn memory remembering CHECK constraints in a read-only database.