chg: do not close dir fd while iterating
It works so long as the dp is the last entry, but readdir(dp) would fail
with EBADF. Let's not do that and close the dir fd explicitly.
#require docutils gettext $ $TESTDIR/check-gendoc zh_CN checking for parse errors