Miley pitches Diamondbacks past Royals 2-0