Lack of inventory, higher prices push housing affordability near two-year low