[1.7.x] Fixed #22477 -- Removed contrib middleware from the global settings defaults.

Also added a compatibility check for changed middleware defaults.
[1.7.x] Added django.utils.six.buffer_types

and used it in the Oracle SchemaEditor. Refs #22715.

Backport of 06c0e740a4 from master
[1.7.x] Fixed #22816 -- Corrected Oracle feature flag and fixed introspection test

Backport of 6122904 from master