Cabrera leads Giants past Diamondbacks 3-1