DuPont and Dow Chemical, with more than three centuries of history between them, said on Friday they had agreed to merge, in one of the biggest deals of the year.