Depends what aperture you shoot at also, if you're shooting landscape and architecture you'd probably be using at least f8 or f11, and between the two lenses, there's little difference in image quality at those apertures, even the 17-40 @ 24mm will have little to no noticable difference in image quality.
But you should also consider barrel distortion. The 24-105 @ 24mm has a massive amount of distortion, which isn't good for architecture, but also when I stacked a couple of filters it had terrible harsh vignetting from the filters, I assume due to the amount of distortion this lens shows, as I did the same on my 24 II and had no vignetting.
But the Tamron is only slightly better in this regard, and the 17-40 @ 24mm is probably the best out of the three at controlling distortion.
If I were you, I'd just get the 17-40, especially since you're going to get an ultra wide down the track. Unless you need the focal length between the 17-40 and your 70-200 then the 17-40 is a great performer for the price, since you're shooting at f8+ anyway. It can also do ultra wide, and is much much lighter and smaller than the two, and may come out a little cheaper even if it doesn't come in a kit.
But if you must decide between the two, I'd get the Tamron. It's a better all rounder lens if you're just mainly comparing image quality, and you may need 2.8 one day, and when you're not shooting at f8+ the Tamron will produce sharper images and have better colour reproduction.
But it also has a 82mm filter thread, so that may be a problem if you currently use filters or looking at getting filters in future. 82mm costs alot more, so factor that into your kit costs as well.
Though either way you'd be good, the 24-105 is a great lens as well, I've had no complaints about mine (other than when stacking filters, which I worked around anyway), and only sold it because I got the 24-70 ii.