Foundations of the quantum statistics of systems in equilibrium: A measuretheoretic approach