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
dlsym: Restore KK transitivity for blobs that need it

Some blobs prefer the old way of looking up symbols instead of the
new, improved routines.

Edited by raymanfx: only change runtime behaviour if new_p != old_p

Change-Id: Iabdcc94f16359f6535eff901d5583922e7f42f29