(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.
Merge pull request #63 from peterhuene/cfact/37

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