Fix insmod module size

read_file() used to append a new line character to the end of the buffer it
returns, because parse_config() isn't able to cope with input that's not
'\n'-terminated. Fix read_file() to be less insane, and push the workarounds
into the parse_config() callers.

Longer term we should rewrite parse_config().

Bug: http://b/21079470
Change-Id: Ie9d9a7adcd33b66621726aef20c4b8cc51c08be7
(cherry picked from commit eaa3b4ec6f79fe06163b8dd6fe8ba2581d3b9c0b)
diff --git a/init/builtins.cpp b/init/builtins.cpp
index f59d1fe..735033e 100644
--- a/init/builtins.cpp
+++ b/init/builtins.cpp
@@ -57,16 +57,13 @@
 
 static int insmod(const char *filename, char *options)
 {
-    std::string module;
     char filename_val[PROP_VALUE_MAX];
-    int ret;
-
-    ret = expand_props(filename_val, filename, sizeof(filename_val));
-    if (ret) {
+    if (expand_props(filename_val, filename, sizeof(filename_val)) == -1) {
         ERROR("insmod: cannot expand '%s'\n", filename);
         return -EINVAL;
     }
 
+    std::string module;
     if (!read_file(filename_val, &module)) {
         return -1;
     }