To unlock undo manager unlock() has to be executed number of times lock() has been.
Merge branch 't/10131'