Fix linkage computation for local types in template functions.

Template functions (and member functions of class templates) present the same
problem as inline functions. They need to be uniqued, so we need to assign
VisibleNoLinkage linkage to types defined in them.
Fix a typo (chek => check)