New York City Council passed a bill giving qualified nonprofits first chance to buy certain distressed buildings. The measure has the mayor's support and aims to preserve affordable housing.