Dimensional reduction and screening masses in pure gauge theories at finite temperature