Measurement of branching fractions and resonance contributions for B0 ---> anti-D0 K+ pi- and search for B0 ---> D0 K+ pi- decays