diff.c: move diffcore_skip_stat_unmatch core logic out for reuse later