A prolonged global memory shortage is reshaping the smartphone market, pushing up costs and signaling the end of the ultra-affordable handset era.