The Walt Disney Co. swung to a loss in its second quarter because of restructuring and impairment charges, but its adjusted profit topped expectations and its streaming business turned a profit. Theme parks also continued to do well and the company boosted its outlook for the year.