[Triton] Fix a use-after-free bug in LinearLayout::compose.
[Triton] Fix a use-after-free bug in LinearLayout::compose.

`output.apply(bases)` returns a temporary object and `llvm::make_second_range` doesn't copy or take ownership. As a result, `newBases` points to deallocated memory.

Also rename `newBases` to `outerBases`, because there is `newBases` variable in the outer scope.
