Fixed #21821 -- db_type argument for field_cast_sql

The db_type argument for connection.ops.field_cast_sql wasn't correctly
set after merge of custom lookups patch.
Fixed typos spotted by Claude Paroz
Stopped assuming that INSTALLED_APPS only contains app names.

While this assumption is true for the time being, it makes the code
needlessly brittle.
Fixed #21712 -- Moved autodiscover() to AdminConfig.ready().

Thanks Marc Tamlyn for the initial version of the patch.