ueventd: do not reference init's sehandle

Init exposes a global 'sehandle' that ueventd references as part of
devices.cpp and util.cpp.  This is particularly dangerous in
device_init() in which both uevent and init write to this global.

This change creates a separate local copy for devices.cpp and puts
restrictions on where init.h can be included to make sure the global
used by init is not reference by non-init code.  Future changes to
init should remove this global.

Test: Boot bullhead

Change-Id: Ifefa9e1932e9d647d06cca2618f5c8e5a7a85460
diff --git a/init/descriptors.cpp b/init/descriptors.cpp
index bc6bc8d..b2142ca 100644
--- a/init/descriptors.cpp
+++ b/init/descriptors.cpp
@@ -80,7 +80,7 @@
   int flags = ((type() == "stream" ? SOCK_STREAM :
                 (type() == "dgram" ? SOCK_DGRAM :
                  SOCK_SEQPACKET)));
-  return create_socket(name().c_str(), flags, perm(), uid(), gid(), context.c_str());
+  return create_socket(name().c_str(), flags, perm(), uid(), gid(), context.c_str(), sehandle);
 }
 
 const std::string SocketInfo::key() const {