Fixed missing 'closed' attribute on TemporaryFile class. Fixes #11857.

- TemporaryFile should minimally mock the API of tempfile.NamedTemporaryFile
  from the Python standard library to avoid AttributeError exceptions.
- The symbol django.core.files.NamedTemporaryFile is actually assigned as a
  different class on different operating systems.
- The bug only occurs if Django is running on Windows, hence why it was hard
  to diagnose.