A tentative deal has been struck to avoid a residential building worker strike in New York City.