Technology stocks have long been seen as the market’s most rewarding but riskiest investments. Bonds have the opposite reputation. This year, both have ended up in the same place — deep in the red.