Scattering theory of thermocurrent in quantum dots and molecules