Analysis of the decays B→ππ and πK with QCD factorization in the heavy quark limit