Add support for -R (recurse) to init chown builtin.

This is helpful for setting ownerships on entire directory trees,
such as sysfs and selinuxfs, particularly when the precise set of
files is dynamically generated at runtime.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>

Change-Id: I81070ea36fd7ffcab4ee8b3ef1bb0028d4b7839c
init: Check for symlinks with lstat() not open()

Using open() with an O_NOFOLLOW flag will result in a file falsely
being determined to be a symlink if the open fails for another
reason.

For example, a character device that isn't ready due to the
underlying hardware not being initialized yet will fail to open()

An example of this are any CG2900 device files prior to
execution of ste-cg29xx_ctrl

This uses lstat() instead of open() with O_NOFOLLOW to check
whether a file is a symlink or not.

Change-Id: Ie0d8d94b426c84c29b1b04d41a4cc15536cb307c
Merge "Add support for -R (recurse) to init chown builtin." into android-4.4
Merge remote-tracking branch 'cm/android-4.4' into android-4.4