Charged kaon production in pion-nucleus reactions at 1.7 GeV/c