Bedard earns first win, Pirates beat Braves, 4-2