Food ingredients giant Archer Daniels Midland has ridden the wave of rising commodity costs and posted a rise in second-quarter profits.