Make `rbt install` work correctly on Windows.

Review Request #8354 — Created Aug. 26, 2016 and submitted — Latest diff uploaded

Information

RBTools
release-0.7.x
19f4dd7...

Reviewers

Unfortunately, the technique of using NamedTemporaryFile in a context manager
and yielding the filename back, then reopening it from elsewhere in the code
caused various permission errors when running on Windows.

This change rearranges the code a bit to make sure we flush and close the file,
and then handles cleanup ourselves.

Used it on OS X, and a customer reports success running on Windows.