Ensure context_locals fails softly when not a dict