diff-lib: use ce_mode_from_stat() rather than messing with modes manually