Soft Phonons and Structural Phase Transitions in La1.875Ba0.125CuO4