Fixed #6308: Properly associate Function with Scope for destructors in SymbolDatabase