Fix panic with doc collision orphan.
As I feared, the collision removal added in #9077 caused problems due to orphans left in the unit graph. Ironically, it was the collision warning detection code which failed, as it iterates over all the keys of the graph.
The solution is to remove all orphans from the graph after collisions have been removed.
Fixes #9136