SymbolDatabase: reintroduce test, move symboldatabase cleanup code to SymbolDatabase destructor