Also explicitly close /dev/tty fd instead of relying on closefrom() in case the fd ends up being a value 0-2.