For decades, investors have turned to the yen during market shocks, from financial crises to geopolitical blowups.