Close files used by subprocess in windows
Close files used by subprocess in windows

Just passing the file descriptor as stdout/stderr to a subprocess
makes windows complain that the subprocess is still using the
file after returning. To fix this we can open the file in the
parent process (inside a with statement) and pass the file handle
to Popen.

secure-systems-lab/securesystemslib,secure-systems-lab/securesystemslib