Determination of the D0→K-π+π0 and D0→K-π+π+π- coherence factors and average strong-phase differences using quantum-correlated measurements