Fix a bunch of small system/core bugs.

Missing frees in:
  adb/file_sync_client.c
  fastboot/fastboot.c
  libsparse/output_file.c

Missing closedirs in:
  adb/file_sync_service.c
  cpio/mkbootfs.c
  libcutils/dir_hash.c

Potential buffer overrun in:
  gpttool/gpttool.c

Incorrect NULL check in:
  libsparse/backed_block.c

Bug: https://code.google.com/p/android/issues/detail?id=61564
Change-Id: If97838a9e73a77aef7f416c31c237ce1fca4ce21
Set init.d permisions

Change-Id: Ib7f72fe03cb8043985a000739cbbd08c76a057ee
init.rc: Add missing permissions and fix existent ones for interactive, add ondemand ones aswell. Yea Google derped it.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>
init.rc: Restored TCP performance tuning

This patch tunes the TCP buffer sizes for high
performance data links including global max rmem
and wmem.

Change-Id: I78dc92bc8190883686678230b0a34a8e32507fa5
CRs-Fixed: 439205 435908
init: added missing permissions

Else PerformanceControl will not be able to change them
-scaling_min_freq
-scaling_governor
-I/O scheduler

Change-Id: I55eb68087e991a906d91009b0a9bc43f0b162635

Conflicts:
	rootdir/init.rc
init: fixup cpufreq permissions

It is safe to have read permissions for everyone
Also required for the CPU info overlay service

PS3:
add cpu0-cpu3

PS4:
mke this work on at least a few devices :)

Change-Id: I1de067f63121a8a19f29d4e994fbc3bf73054556
allow system to modify ksm control files
sysinit support