Make getdirentries(2) correctly fail with EINVAL for an invalid file