As recently as last month, federal housing officials were poised to cut off funding to a troubled Lansdowne apartment complex, lawyers said, and give residents vouchers to move — away from electrical fixtures that would shock them, “black gunk” burbling up through tub drains and, in at least one case, a ceiling laden with bat guano…