libchrome: Remove usage of readdir_r()

readdir_r() is deprecated, which causes build failures when using
glibc-2.24 or newer headers.  This CL replaces usage of readdir_r()
with readdir(). Part of it is a cherry-pick of
http://crrev.com/4e33415240d5799

BUG=chromium:859601
TEST=emerge-samus libchrome with glibc 2.27

Change-Id: If530eeb5faf7748b59fdd7a367a03ff02eaa95a1
Reviewed-on: https://chromium-review.googlesource.com/1123101
Commit-Ready: Yunlian Jiang <yunlian@chromium.org>
Tested-by: Yunlian Jiang <yunlian@chromium.org>
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
2 files changed