Ferromagnetism Stabilized by Lattice Distortion at the Surface of the <i>p</i>-Wave Superconductor Sr<sub>2</sub>RuO<sub>4</sub>