US nut maker Diamond Foods has swung back into profit during its fiscal third quarter.