don't cache invalid subsets when preloading hmt associations.

Backport #9252.

Conflicts:

	activerecord/CHANGELOG.md
	activerecord/test/cases/associations/eager_test.rb

The preloader code on 3-2-stable is not based on relations but on option hashes.
I had to modify the original patch and comparing the option hashes could be more
fuzzy than comparing the relations. All the tests passed though.
Merge pull request #9322 from senny/backport_9252

don't cache invalid subsets when preloading hmt associations.