Exact solution for the Schwinger model at finite temperature