Undo manager async

Make sure our handling of asynchronous regular and batched undos is correct