Checked more precisely whether the app registry is ready.

Accounted for the three stages of population: app configs, models,
ready() methods of app configs.
Fixed #22939 -- Delayed admin_static backend detection

Thanks generalov for the report.
Added a newline to appease flake8