Investors, worried about artificial intelligence disrupting software companies, are skirting the most-troubled US junk debt even as they embrace risk in other markets.