liblog: O_CLOEXEC flag on opens

(cherry pick from commit 78786da116064e6a2b7bb768e1eb77f3804eace4)

Bug: 28455828
Change-Id: Ic00101a6192aab7271cb0c3461e249a77d7f29ed
diff --git a/liblog/logprint.c b/liblog/logprint.c
index 9b60d4a..c8457f4 100644
--- a/liblog/logprint.c
+++ b/liblog/logprint.c
@@ -1042,7 +1042,7 @@
          * Anything in the Android Logger before the dmesg logging span will
          * be highly suspect regarding the monotonic time calculations.
          */
-        FILE *p = popen("/system/bin/dmesg", "r");
+        FILE *p = popen("/system/bin/dmesg", "re");
         if (p) {
             char *line = NULL;
             size_t len = 0;