Fix for NUTCH-151: CommandRunner can hang after the main thread exec is finished and has inefficient busy loop.
Fix for NUTCH-151: CommandRunner can hang after the main thread exec
is finished and has inefficient busy loop.

  I encountered a case where the JVM of a Tasktracker child did not exit
after the main thread returned; a thread dump showed only the threads named
STDOUT and STDERR from CommandRunner as non-daemon threads, and both were
doing a read().  CommandRunner also had an excessively costly busy loop.
These problems were fixed by:
1. The pipe io threads should be daemons.
2. The main thread should always interrupt() the pipe io threads when
   finishing up, not just when a timeout occurs.
3. Sleep before testing whether the process has finished with
   Process.exitValue().
4. Increased the sleep time to be 1000msec.


By Paul Baclace.


git-svn-id: dd969ffd0b1e2aca00ff23b3edadceba2772a27a@366571 13f79535-47bb-0310-9956-ffa450edef68

toddlipcon/nutch,toddlipcon/nutch