[REG2.065a] Issue 11718 - Unintended mangled names conflict of nested template structs

https://d.puremagic.com/issues/show_bug.cgi?id=11718
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](https://d.puremagic.com/issues/show_bug.cgi?id=9271) in #2877, I had naturally expected that behavior. However sadly `mangle` function had had a bug.