The company said on Wednesday it would close about Gap and Banana Republic stores, just the latest paring of what was once a sprawling retail footprint. But in a sign of its shifting.