Optimized RAO for the common case

Now RemoveAbandonedOutputs costs only 2 Stats per
ordinary build where build.ninja was not regenerated.

Additionally cordoned the logic into one neat little function.