SymbolDatabase: Refactor findFunction handling. Ticket: #4494