Fixed array detection on public download

When downloading a folder called "0001" PHP should fallback to parsing
it as string and properly detect that it is not a JSON array.

Fixes https://github.com/owncloud/core/issues/11425

Please review @schiesbn @MorrisJobke @zlydk @icewind1991