Map operationPromise to undo entry earlier

Otherwise we were adding it to the stack and potentially distributing
changes about a new undo operation being available without the entry in
place.