Private-equity firms are stepping into the vacuum left by banks' flight from lending to small and midsize home builders.