Linking Demand and Supply in a Housing Market Sorting Model