Cahill pitches Diamondbacks past Rockies 5-2