Measurement of tau decays into three charged pions