Prevent duplicate files when streaming download

Per RAZOR-73: When downloading a file for a repo, the code would have two temporary files: one from open-uri and one the code created explicitly. In addition, open-uri's temporary files were not getting cleaned up. This now moves open-uri's tempfile in an attempt to avoid creating a duplicate. Added tests for redirect and cleanup for post-test files.