If a table is opened and then later its parent database is closed, db_current_table() still reports it as the current table.
Instead, when the current database is closed, db_current_table() should be reporting 'undefined'.