count correct array, then using 1000 as MAX_SQL_CHUNK_SIZE works as expected

found during fixing the backport for stable 5, see PR https://github.com/owncloud/core/pull/5487

@karlitschek @DeepDiver1975 @bantu @icewind1991 please review