WIP - try to figure out race condition

Based on the localStorage-only failures in https://github.com/pouchdb/pouchdb/pull/2846, I've been trying to figure out if there's a race condition in localstorage-down.

I noticed @calvinmetcalf's fixed in memdown (https://github.com/rvagg/memdown/commit/8a3c6a02954f6dcfc7e74b209a897654cdbb282c), but after copying the test and the fix over, it doesn't seem to have an impact here. The test was already passing before. Added another test, but same story - it was already passing.