Don't save through records twice (4-1-stable)

If the through record gets created in an after_create hook that is
defined before the association is defined (therefore after its
after_create hook) get saved twice. This ensures that the through
records are created only once, regardless of the order of the hooks.
Merge pull request #15729 from sgrif/sg-double-save-hm-t-4-1-stable

Don't save through records twice (4-1-stable)

Conflicts:
	activerecord/test/cases/associations/has_many_through_associations_test.rb