(#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.
when `bulkDocs` calls out to the other `api` methods, it needs to use lockless versions or else it never completes