Mahindra to take over Ssangyong