Removed code deprecated from Django 1.2
Fixed a few ResourceWarning in the test suite. Refs #22680.
Fixed a ResourceWarning that wasn't properly fixed by the previous commit.

Also removed unused import in runtests.py.
Fixed a few warnings in the testsuite.
Removed executeable bit from a few files.
Properly close any file in request.FILES at the end of a request.
closed as many files as possible in form wizard.