tdb: Fix tdb_check() to work with read-only tdb databases.