Fixed: On Windows, a NamedTemporaryFile cannot be opened for reading until it is closed.
Fixed: cmd may be a list.