libarchive: Stop using readdir_r()
It cannot be used safely, though libarchive goes to ridiculous lengths
to attempt to do so.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D51679
(cherry picked from commit 01e42ce81f751ccbeeddc4bc2716e6bd634cf5f8)