login_tty: Make the replacement code work on BSD systems.