Correctly alias table names when joining more than once

See #14155 for a longer description. 

The attached commit has some notes; I'd appreciate some feedback, as the change to `AliasTracker` seems particularly hackish to me. All the tests pass, but the also all passed *before* I added the one in this commit :) so I'm uncertain if this is a well-covered area of functionality.

/cc @tenderlove