Marlins beat Giants 3-2 for three-game sweep