[REG2.067a] Issue 13379 - Latest dmd fails with recursive template expansion in std.regex

https://issues.dlang.org/show_bug.cgi?id=13379
This part is a refactoring change. By the fix, we can assume that `this` never appear in the `tinst` chain. So the loop condition can be simplified.