Cache: provide a function to get the permissions of all files in a folder with one query

This gives a massive performance increase for calling getDirectoryContent on large folders.

@MTGap Sharing will need to provide this function before this can be merged.

cc @DeepDiver1975 @karlitschek