Adding the close_fds flag to POpen to close all file descriptors prior to executing the command.