(#2293) - allDocs callback never called if database closed

Fixed by checking docCount for 0 and returning empty array.
Test closes the DB (actually a cached one). Without this fix,
the allDocs callback is never called!