Reimplemented TraitsInConstructOrder()

For https://github.com/OpenRA/OpenRA/issues/6701

Hopefully this should be better
No, this is benign -- the closure doesn't outlive a single loop iteration. A naive static analyzer will still complain though, since it can't know .Any() doesn't stash its argument.