Part 1 of terminal support fix

Changed the daemon to use pseudo-terminals closer to the way SSH or telnet does. Changes are extensive because the slave device was being opened by the wrong end of the connection, ie. the client is the one which should be opening the master ptmx device.

SIGWINCH is still not being handled. The next commit will attempt to address this.
Added SIGWINCH handling and better cleanup

Added a task to forward SIGWINCH from the client to the daemon via the
correct ioctl. Terminal window sizing now seems to work correctly.

Also added signal handler to catch signals which can cause the client to
terminate, allowing the client to restore stdin's termios. Previously,
killing the su client using (for example) SIGTERM would result in the
terminal being left in an unusable state.
Refactored pseudo-terminal code into pts.c
Undo a change which resulted in dangling FDs
Removed a hackish check for stdout in pump()
Made scoket protocol uniform

Also eliminated some control flow branches
Changed when the client sends pts-slave
Treat each standard I/O stream separately
Eliminated use of FIFOs, factored PTY proxy code

Instead of opening FIFOs, we now send the standard I/O descriptors
across the Unix socket.

Also, the I/O pumps were moved to pts.c
Update version check to work with >= 4.3

Now that 4.4 is out, the check was failing and not properly setting up
the su daemon.

Using POSIX sh parameter substitution allows us to extract the major and
minor version numbers from ro.build.version.release in build.prop and
compare them.

This was tested on a Nexus 4 running 4.4.
Merge pull request #194 from tmzullinger/kitkat-version-check

Update version check to work with >= 4.3
README: Update build information

Specify the required SDK API and NDK versions.  Add info on signing the
release build, as build.xml is hardcoded to use Superuser-release.apk only.
reboot: Build utility from source

This was based on disassembling the HTC ARM reboot binary currently
shipped with Superuser.  It attempts to mimic the behavior of the
original program.

Future work may involve cleaning it up, removing the HTC-specific
features, etc.
MainActivity: Split getArch() into a common function
Use new assets/<ARCH>/reboot binary

Now that we are building the reboot binary from source, we'll need to
retrieve it from the proper subdirectory according to the device's CPU
architecture.
Add MIPS support

Tested on:
 - Ainol Novo 7 Paladin (JZ4770 MIPS SoC) with ICS 4.0.3 and CWM
 - Nexus 5 (ARM) with KK 4.4 and TWRP

Not tested on x86.

I checked to make sure "uname -m" is standard in busybox (not a feature
flag).  "uname" doesn't seem to exist at all in AOSP, so without busybox,
the original script probably wouldn't have detected the architecture
correctly.
Merge pull request #195 from cernekee/mips-v1

Add MIPS CPU support
Merge remote-tracking branch 'koush/master' into cm-10.2
comment out hte multiuser stuff that is breaking regular ndk builds

Change-Id: I535472084833883e5bedb1631dcb309b6d9e77a3
1022

Change-Id: I36b8e616895ccaeaa1d886346ba18e27cef3c63a