Update and fix Terminal.

As of today, bionic has <pty.h>, so there's no need to have another
here.

Also fix bugs introduced in attempts to make this code 64-bit clean.

Change-Id: I40746920764e84a829a3d1df5a900a419589b84a
4 files changed