appium/appium — pull request #3890 by rgonalo (2014-10-24 14:29:04+00:00)
Title: Fix EPERM error in Windows when using a remote apk already signed

If a remote signed apk is tested on Windows, Appium returns the following error "error: Failed to start an Appium session, err was: Error: EPERM, rename 'C:\Users\username\AppData\Local\Temp\appium114921-10216-1lljdnj.tmp'"

When Appium downloads the remote apk, the file descriptor, opened by tmpdir, is never closed.
If the apk is already signed for debug, Appium executes the zipalign and tries to overwrite the temporal apk.
In Windows, this overwriting is forbidden and generates the EPERM error.

Solution: close the file descriptor returned by tmpdir