Cabrera's two homers lead Giants in win