What are the semantics if the members, especially write_txn ?
I naively expected write_txn to mean "this transaction modifies the database and we want to save the change when we're done", but that doesn't seem to match how it's used !
Some documentation in the struct definition would help.  Could also describe the TLS workings.