MFC of 348074
Rewrite fsck_readdir() and dircheck() for clarity and correctness.
Approved by: re (gjb)