Compass is acquiring rival Anywhere Real Estate in a $1.6 billion all-stock deal, signaling major consolidation amid slumping home sales.