Danone has signed a deal to buy the nutrition unit of India's Wockhardt Group, days after reports that the companies were in talks.