Move the terminal handling code to a later location; this allows the signal handlers to be set up; it also means that a failed name lookup won't mess up the nokerninfo setting of the tty.
Move the terminal handling code to a later location; this allows
the signal handlers to be set up; it also means that a failed name lookup
won't mess up the nokerninfo setting of the tty.

Reviewed by:	pst, nate

jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase