Dollar and yen rise as tech selloff sends investors to safety