Close the file returned by popen