OS independent and secure pty/tty and utmp/wtmp/lastlog handling
