Fixed #22017 -- Prevented RuntimeError on Python 3

Refs #21049. Thanks quinox for the report.
Fixed #22025 -- Listing app followed by app.Model in dumpdata command

When invoked as follows:

  $ python manage.py dumpdata blogapp blogapp.Tag

Django would throw a TypeError. This commit fixes the problem and provides
a test.
Reworked the detection of local storages for the collectstatic command.

Before 4befb30 the detection was broken because we used isinstance
against a LazyObject rather than against a Storage class. That commit
fixed it by looking directly at the object wrapped by LazyObject.
This could however be a problem to anyone who subclasses the
collectstatic management Command and directly supplies a Storage class.

Refs #21581.
Add --empty option to makemigrations
Remove redunant code from RunPython operation
Fix my slightly hasty autodetector changes
Add reference documentation for operations and stubs for schemaeditor.
Reverting unapplied migrations check away from being a system-level check.

This reverts commit 0ac13eccebb3d879f79b31585b1e81f655067179.
Fixed #21856: Don't crash runserver when DATABASES = {}