Now that dd_size is unsigned, we need to check if the return value from
getdirentries() was negative before assigning it to dd_size.
While here, simplify the scandir_error test case slightly, and verify
that calling readdir() again after EOF still returns NULL.
Fixes: 42e613018da5
Sponsored by: Klara, Inc.