Corbin, Diamondbacks beat Giants 5-1 to end skid