[1.7.x] Fixed #22588 -- Fix RegexValidator __eq__

Compare parameters instead of re.pattern instances, and add the other
parameters to the comparison. Also add a __ne__ to make assertNotEqual
work properly.
[1.7.x] Fixed #22476: Couldn't alter attributes on M2Ms with through= set
[1.7.x] Removed unused imports in makemigrations

Backport of fc32e9c0d from master.
[1.7.x] Appeased flake8.

Backport of b1432bfc from master
[1.7.x] Reorganized backends tests.

This reduces the number of explicit vendor checks.

Backport of d6672631 from master
[1.7.x] Simplified indexes tests.

Backport of 43a80f48 from master
[1.7.x] Replaced vendor checks by three feature flags.

Backport of c70a61eb from master
[1.7.x] Split ignores_nulls_in_unique_constraints feature.

Oracle and SQL Server don't have exactly the same limitations. It's
worth treating them differently.

Backport of cff59bed from master
[1.7.x] Added feature flags for introspection capabilities.

Backport of 99d9fa32 from master
Merge pull request #2637 from davidszotten/validator_comparisons

[1.7.x] Fixed #22588 -- Fix RegexValidator __eq__
[1.7.x] Fixed #22563: Ignore AUTH_USER_MODEL errors in from_state
[1.7.x] Fixed #22325: Ignore __first__ dependencies to your own app
[1.7.x] Tests for #22325
[1.7.x] Fixed #22606 -- Locmemcache has_key() failed for infinite cache expiry

Refactored cache expiry logic for Locmemcache to make consistent across
all places where accessed, and correctly handle None as expiry time.
Backport of 66880e4cd from master.
Made explicit lack of microsecond handling by built-in datetime fields.
Used that explicitness to appropriately nix microsecond values in bound fields.
Fixed Django ticket 22502.