fix double render uploading a file and getting a permission error

test plan:
 * go to a course files page
 * in another tab, log out
 * in the first tab, attempt to upload a file
 * it should fail
 * inspect the rails log or watch network requests. the preflight
   request should have failed with a 401 unauthorized, not a 500
   internal server error

Change-Id: I0eccc9574e658cc67216de8645d263ea1e9fdcd4
Reviewed-on: https://gerrit.instructure.com/28225
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Anthus Williams <awilliams@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>