It might be better to use a transaction/rollback, as we used to do in _is_read_only_database(). It makes no difference now, but IMHO it makes the code a bit cleaner.