Fix ensure loaded for files and dirs.
Fix ensure_loaded return value for remote packages.
Perform integrity check early if all packages are downloaded.

If all packages are downloaded then just do integritycheck without
bothering a user with multiple queries.

Suggested by:	az