Quantum Statistical Mechanics, Noncommutative Geometry, and the Boundary of Modular Curves