Doubly and singly Cabibbo suppressed charm decays into the K+pi−pi+ final state