Fixed bug where parent did not close all file descriptors.