Energy Analysis of the Deformation and Failure Process of Sandstone and Damage Constitutive Model