Add TestEntryModel::testDatabaseDelete().

It tests that EntryModel in EntryList mode correctly
removes entries from the model when that database of
these entries is deleted.
Close AutoTypeSelectDialog when there are no entries left.

This happens when the entries were deleted or the database
has been closed.