[std] Prevent process stdin being closed twice (#743)
When running `process_stdin_close`, the handle is made available again
and may be reused in another part of the program. This means that it is
not safe to rerun `CloseHandle` in `process_finalize`, since that could
cause us to close a handle that no longer belongs to the process.