Fix race condition due to call of `Tree.symbol`

Calling `askOption` directly in the traverser is extremely expensive,
therefore it should happen as less as possible. Because the check if
the symbol exists is only necessary for dynamic types, which are not
used very often, it is only done when no other information in the tree
could be found.

Fixes #1002132
Merge pull request #711 from sschaef/t1002132-race-condition-due-to-symbol-call

Fix race condition due to call of `Tree.symbol`