change order of issubdirectory() calls to avoid error messages for non-apps

The issue was discussed here https://github.com/owncloud/core/issues/4828#issuecomment-33475102

The problem, for "settings" and "core" getAppPath() returns false which will lead to an error in issubdirectory(). The solution, first checks all the core paths and only is all this test fail we look for an apps folder.