Fix rotating log on the Windows bots when used with subprocesses.
Fix rotating log on the Windows bots when used with subprocesses.

Due to the use of subprocess call on Windows, the file handle stays open in the
subprocesses even if the log file is not used. Because of this, when the
RotatingFileHandler tries to os.rename() the file, it fails with:
    WindowsError: [Error 32] The process cannot access the file because it is
    being used by another process

This didn't fail on the other tool (like run_isolated.py) because we were lucky
since the process is relatively short lived, so only a small amount of log was
lost. This fix works around the problem by duplicating the file handle and
forcibly making it not inheritable to the child processes.

R=csharp@chromium.org
BUG=

Review URL: https://codereview.appspot.com/103280043

luci/luci-py,madecoste/swarming,madecoste/swarming,luci/luci-py,pombreda/swarming,luci/luci-py,pombreda/swarming,pombreda/swarming,madecoste/swarming,luci/luci-py,pombreda/swarming,madecoste/swarming