Merge "Work around readdir_r warnings until we upstream a fix." am: 18db0829f5
am: 86178f524f

Change-Id: Ifaaa01e9113aa46b6a283d874bd1f4e5435c4430