ensure_completely_loaded: Only set COMPLETELY_LOADED to True if app cache is ready

Refs #323. Thanks to Simon Meers for the report and for finding a solution.
Merge branch 'master' into next

* master:
  ensure_completely_loaded: Only set COMPLETELY_LOADED to True if app cache is ready