json encode download list [stable45]

fix for #2150 in stable45. The same fix was already merged into master.

Only difference: In OC4.5 we need a workaround to detect /Shared as a folder to download it correctly. I moved this workaround from download.php to filestorage/local.php

@icewind1991 @MTGap would be good if you could have a look at this patch, especially at the part with the workaround for the Shared folder.