Set errno every time before readdir.

Reset errno every time readdir is called. According to the man pages,
readdir may:
- return a non-null ptr on success (errno may be changed or not)
- return a nullptr with errno unchanged when terminated
- return a nullptr with errno set accordingly if error

So, it is theoretically possible that previous readdir calls sets errno
even on success, but subsequent calls don't clear it. This is not true
in bionic's implementation, but let's fix it anyway.

Test: stress test
Bug: 155407386
Change-Id: I5407099747bbc199a48e8fdb98d8cde848db6640
1 file changed