Fix that a collection proxy could be cached before the save of the owner, resulting in an invalid proxy lacking the owner’s id.

Absent this fix calls like: owner.association.update_all to behave unexpectedly because they try to act on association objects where
owner_id is null.

more evidence here: https://gist.github.com/Empact/5865555
```
Active Record 3.2.13
-- create_table(:firms, {:force=>true})
   -> 0.1371s
-- create_table(:clients, {:force=>true})
   -> 0.0005s
1 clients. 1 expected.
1 clients updated. 1 expected.
```

```
Active Record 4.0.0
-- create_table(:firms, {:force=>true})
   -> 0.1606s
-- create_table(:clients, {:force=>true})
   -> 0.0004s
1 clients. 1 expected.
0 clients updated. 1 expected.
```
Fixes a bug found when running individual tests against #17217 after merging
Merge pull request #11694 from Empact/association-bind-values-not-updated-on-save

Fix that a collection proxy could be cached before the save of the owner, resulting in an invalid proxy lacking the owner’s id

Conflicts:
	activerecord/CHANGELOG.md
Merge pull request #17578 from codeodor/fix-17217-test-bug

Fix bug found when running individual tests against #17217 after merging
tiny code improvement in sqlite3 adapter:
  - remove unused method `supports_add_column?`
  - change additional restriction method to `valid_alter_table_type?`
  - fix code style
Merge pull request #17579 from aderyabin/cleanup_sqlite

Tiny improvement in sqlite3 adapter
remove never called method `limited_update_conditions`
Merge pull request #17585 from aderyabin/remove_limited_update_conditions

remove never called method `limited_update_conditions`
Make `:index` in migrations work with `add_column`