A.I. companies are buying up memory chips, causing the prices of those components — which are also used in laptops and smartphones — to soar.