When the California teachers case was argued, Justice Antonin Scalia was still alive, and the court appeared ready to hand public unions a setback.