Artificial intelligence will be painful, but it brings with it opportunities, Alibaba CEO Jack Ma tells CNBC.