Measurement of the D+ ---> pi+ pi0 and D+ ---> K+ pi0 branching fractions