Grouping thread locals in the ActiveRecord scopes so that the
current_scope and ignore_default_scope locals are brought together under
a registry object.
Merge pull request #10135 from wangjohn/grouping_thread_locals

Grouping thread locals in the ActiveRecord scopes