Sound speed is inversely proportional to the square root of the air density. In the upper atmosphere, sounds moves faster, but Mach number is calculated for a given pressure, so it takes that into account.
He also wasn't in a vacuum, just sparse atmosphere. Finally, the boom is caused by a pressure wave and occurs closer to the observer, where the air is denser.