(#2951) - fix concurrency in leveldb.js

So I figured out where the bug was coming from - I had
not implemented the writeLock correctly. Took this opportunity
to also use the `double-ended-queue` as suggested by
@calvinmetcalf.
don't need a global lock anymore, just a per-`bulkDocs` one.