SoftBank is set to gain more than $34 billion by cutting its stake in Alibaba, the crown jewel of its investment portfolio, after posting record losses on its tech bets this year.