Only cache enabled apps when logged in

This prevents the enabled apps being cached before the user apps are loaded and the groups of the user are known.

Fixes #9154 

cc @DeepDiver1975 @nickvergessen 
maybe add a comment like in https://github.com/owncloud/core/pull/9163/files