Dimensional reduction of Courant sigma models and Lie theory of Poisson groupoids