Uniform semiclassical approximation in quantum statistical mechanics