Brazilian beef producer JBS has swung into the black in the second quarter, boosted by an increase in sales and a drop in losses on foreign exchange.