Add null checks to <dirent.h> functions.

Move all the new checks over to the existing __fortify_fatal.

Bug: http://b/67455242
Test: ran tests
Change-Id: Idb899c58c32d52d3b423caf1a91feb7defcba9b3
diff --git a/libc/Android.bp b/libc/Android.bp
index 2e5ec00..89d33b0 100644
--- a/libc/Android.bp
+++ b/libc/Android.bp
@@ -14,7 +14,7 @@
     "bionic/siginterrupt.c",
     "bionic/sigsetmask.c",
     "stdio/fmemopen.cpp",
-    "stdio/fread.c",
+    "stdio/fread.cpp",
     "stdio/parsefloat.c",
     "stdio/refill.c",
     "stdio/stdio.cpp",