Fix the following bugs:
Fix the following bugs:

  - if a command was specified and script(1) failed to execute it,
    it would print the name of your shell in the error message
    instead of that of the command that failed.

  - since finish() was installed as a SIGCHLD handler, it would
    often run before the main loop had had time to process the
    last few bytes of output. This resulted in very strange
    truncated error messages.

  - script(1) would almost always return with an exit status of 0,
    even if the command returned a non-zero exit status. This broke
    my 'build world, install it and rebuild the kernel' scripts
    because 'make installworld' would run even if 'make buildworld'
    had failed.

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