Fix luajit compilation failure introduced by the transaction update.
Fix coverity lock issues reported by transaction update as well.