This isn’t a critical change, but abandoned state actually could be lost if the node crashed before a wallet flush, and so it makes more sense for this manual action to be flushed when finished.
(Originally the code was copied from MarkConflicted which is information that would be recreated on startup and is also called inside a loop hence the performance comment)