(CFACT-37) Close open file descriptors before exec.

To ensure open file descriptors aren't leaked to spawned child
processes, close all open file descriptors above 2 (stderr) before
calling exec.
stdout_write was duped to STDERR_FILENO, but now that we're closing all descriptors above 2, this write would be to a closed descriptor.  We should be using STDERR_FILENO here anyway.