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
[skip ci] Document: required `via` option in `match` routing method.
Add documentation to select_tag for :selected option
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
Merge pull request #14915 from juanpastas/patch-1

Update mapper.rb
[ci skip] Security guide clarity.
Merge pull request #14931 from heironimus/security_guide_clarity

[ci skip] Security guide clarity.