Implement <pty.h>.

Based on the package/apps/Terminal implementation. I'll switch them over
shortly. This also lets us build the toybox version of netcat.

Change-Id: Ia922a100141a67409264b43b937eeca07b21f344
Merge branch 'cm-12.0' of git://github.com/CyanogenMod/android_bionic into cm-12.0