(This is an additional UM fix, not originally part of the rewrite)
This helps with #3144 and units not going idle when ordered to clump together.
By rejecting paths that would not take the unit closer to the goal than it is, we can avoid the case where a unit at A finds a short path to B, goes there, gets stuck, finds a new short path to A, etc. ad infinitum.
It doesn't completely fix the problem since two units moving might still occasionally become stuck against one another, but it makes it rarer (unit pushing would probably finish solving this).