For today’s first-time homebuyers, getting a toehold into the pricey housing market increasingly means buying a townhome.