[AST] Convert ASTContext::getSwiftName to a free function
The only state `getSwiftName` uses is its argument, and can be made a free function. Of
note the inverse operation, `getKnownFoundationEntity`, is also a free function. This
removes the requirement that callers have an `ASTContext` instance.
(cherry-picked from commit fb524c0b865659cd81af31241667abf808677006)