lmdb-safe: Remove the read-only transactions counter
LMDB requires:
- a transaction and its cursors must only be used by a single thread
- a thread may only have a single transaction at a time
- but, if `MDB_NOTLS` is in use, this does not apply to read-only transactions.
The first and second points are the reasons why we are keeping track
of transactions, but because of the third point we cannot be strict
with regard to read-only transactions, unless we keep track of whether
the `MDB_NOTLS` flag is in use.
I recently noticed that I made a mistake in
c340aa91bf37d8105d2b2390eecbadfca88c1d27, and `MDBEnv::getROTX()` now returns the number of read-write
transactions instead of the number of read-only transactions. It
also noticed that `MDBEnv::getROTX()` is actually not used, and we
only enforce that a thread that already has a read-write transaction
cannot open another transaction.
Since `MDBEnv::getROTX()` is not used, it makes not much sense to
bear the cost of tracking read-only transactions so this commit removes
the read-only transactions counter.
Another option would be to make lmdb-safe stricter: if we kept track
of whether the `MDB_NOTLS` flag is in use, we could enforce:
- only one transaction when `MDB_NOTLS` is NOT in use. We then
need to check both counters when opening a new transaction.
- only one read-write transaction but several read-only transaction
allowed when `MDB_NOTLS` is in use.
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>