[1.7.x] Fixed #22770 -- Removed create_superuser from post_migrate signals.

Moved logic to syncdb command for backwards compatibility.

Backport of 93d05536fd from master
[1.7.x] Fixed #22477 -- Removed contrib middleware from the global settings defaults.

Also added a compatibility check for changed middleware defaults.