If an error happened during the UpdateNodeStatuses loop, there were some code paths where we would not call SetNodeStatusUpdateNeeded, leaking the state. Add it to all paths by adding a function. Part of #40583