init: switch property_get to use __system_property_get

(cherry picked from commit 2deedfe0b1ac86ebd62d19cf7da9e7dcb508ab09)

Change-Id: If3fba2cc1dd5c167b0924ddfe42dbe2e6387208a
init: harden property service.

Don't create temporary files in a well-known location. Rather,
use mkstemp().

Don't read persistent property files from insecure files.

Change-Id: I81e2aca674a2a7ca54869f088737fb228d3af6d2
Fix dirfd crash issue in property service

In "init: harden property service" patch, dirfd() is invoked
without checking whether opendir() return successfully. It may
fail if load_persistent_properties() is invoked before userdata
partition is mounted; then dirfd(NULL) will make init crash.
This may happen if "is_charger" is true.

Change-Id: I216fb743a3c9fa050f92fcb31b62e766346d84bb
Signed-off-by: Yi-wei Zhao <gbjc64@motorola.com>
Log an error if property pool is exhausted

Failing to set properties due to an exhausted pool leads
to difficult to debug problems. This change adds an
error log to make the situation a bit easier to handle.

Change-Id: Icc1d97a80882fb23e74428a0195f1d28dba68fa8
init: move the system property writer implementation

Move the system property writer implementation into bionic to keep
it next to the reader implementation and allow for better testing.

(cherry picked from commit 9f5af635010a7ba92edf1fca543f7271cc9d75c8)

Change-Id: Idf6100d1d0170751acd5163a22597912bff480f0

Conflicts:
	init/property_service.c