TxEngine: use segment locks rather than global lock