[2.2] Introduce pooling of KernelTransactions.

But `dispose()` set `locks` to `null`, which is called by `close()`. Wouldn't this assertion fail when the transaction object is used, or am I misunderstanding something?