patch popen to always close fds