[Coverage] Consolidate visitation logic for functions and nominal types
This should address an ASAN failure which arose due to the PGOMapping
ASTWalker not being updated in sync with the other profiling-related
walkers.
rdar://39534066
(cherry picked from commit 3a72dd214db4e4bf93d3cad59a927b2132def291)