fix Issue 11718 - Unintended mangled names conflict of nested template structs

If a symbol has parent, the parent part of the mangled name should also be unique in each scopes.

Function symbols can have same identifiers in scope, so their parameters part must be always encoded in their mangled name to distinguish overloads.

When I fixed bug 9271, I had naturally expected that behavior. However sadly `mangle` function had had a bug.