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 remote-tracking branch 'upstream/xpe9' into xpe

Conflicts:
	libc/bionic/pty.cpp
	libc/include/pty.h
	libc/include/utmp.h
	tests/pty_test.cpp
	tests/utmp_test.cpp

Change-Id: I2f4be4b309b8aa81e0f7c6b5e94e36882ce2c5e6