Finite-temperature second-order many-body perturbation and Hartree-Fock theories for one-dimensional solids: an application to Peierls and charge-density-wave transitions in conjugated polymers.