Mike Barry, director of sustainable business at Marks and Spencer, has announced he is to leave the UK retailer later this month.