Implement CTTY grabbing when TIOCSCTTY is missing

AIX is missing TIOCSCTTY, so we assign us a ctty via a open of the slave
device.

Signed-off-by: Anton Lundin <glance@acc.umu.se>