US church closures are prompting some congregations to donate buildings, support affordable housing and leave community-focused legacies