Intermediate spin state of Co 3 + and Co 4 + ions in La 0.5 Ba 0.5 CoO 3 evidenced by Jahn-Teller distortions