Preserve errors from fts_* via fts_children by saving errno over
fchdir(2) and close(2).
This should probably be
serrno = sp->fts_child == NULL ? errno : 0;
since fts_build() may set errno to a non-zero value even if it does not fail (e.g. if symlinks are being followed and there is a dangling symlink (FTS_SLNONE)).
This is maybe now bogus. In particular, the sequence: