Add namespace support for rename operation

So that the let bindings and loop labels with same name won't clash.

Closes #12512.