Remove superfluous checks when closing database.