Roberto Martinez to leave Wigan