Study of the decay $\phi \to \pi^+ \pi^- \pi^0$ with the KLOE detector