gettty/settty - return undef instead of -1 if failure on getattr/setattr/ioctl/fcntl