Clint Barmes homers, Pirates beat Braves 9-2