makeSqliteTransactor = function (setupPromise) {
  var txLock = makeTxLock()
  return function (fn) {
    // 1. wait for the setup promise
    return setupPromise.then(v => {
      // 2. provide a cb handler
      return cbPromise(cb => {
        // 3. create a tx lock
        txLock(endTx => {
          // 3b. wrap the cb with the lock release
          var cbWrapped = (err, res) => {
            endTx()
            cb(err, res)
          }
          // yeesh
          fn(cbWrapped)
        })
      })
    })
  }
}
SQLite transactor, handles common needs for sqlite queries:
1. waits for the setupPromise
2. provides a cb handler that returns a promise
3. creates a transaction lock, and wraps the cb with it
NOTE:
  Using the transactor does mean that the DB is locked into sequential operation.
  This is slower, but necessary if the SQLite instance has any transactions that
  do async work within them; eg, SELECT then UPDATE.
  Why: without the tx lock around all SQLite statements, you can end up injecting
  new commands into the active async transaction.
  If the DB doesn't do async transactions, you don't need the transactor. At time of
  writing this, only the history DB needed it.
  -prf
@param {Promise<any>} setupPromise
@returns {function(Function): Promise<any>}