Elevated mortgage rates and rising home prices are freezing out many would-be buyers, and that's keeping the U.S. housing market in a years-long slump.