Make remote_ip detection properly handle private IPv6 addresses

Fixes #12638.
SQLite3: Always close statements.

SQLite3 adapter must make sure to close statements after queries.

Fixes: #13631
Add documentation to select_tag for :selected option
Give real privacy to class methods in AR::PredicateBuilder
Merge pull request #14916 from moktin/real_privacy_for_functions_in_predicate_builder

Give real privacy to class methods in AR::PredicateBuilder
Merge pull request #14922 from rizwanreza/add-selected-documentation-to-select-tag

Add documentation to select_tag for :selected option
Avoid unnecessary conditional block

GeneratedAttribute#column_name checks already for reference? on the
attribute returning the right name to use as symbol for label and field.
Merge pull request #14928 from potomak/update-scaffold-form-template

Avoid unnecessary conditional block
Merge pull request #13640 from maginatics/fix_sqlite3_ensure_master

SQLite3: Always close statements.

Conflicts:
	activerecord/CHANGELOG.md
Remove unused variable
Merge pull request #12651 from cespare/ipv6-remote-ip-fixes

Make remote_ip detection properly handle private IPv6 addresses

Conflicts:
	actionpack/CHANGELOG.md