Update models.py

When using the request middleware, if the user is anonymous an error is raised stating that the 'history_user' attribute must be an instance of User. As this field can be null, get_history_user has been updated to return None if the user is not authenticated. Also made the returning of None explicit.
Update test_admin.py

Added test for allowing Anonymous user when using HistoryRequestMiddleware.
Update test_admin.py
Update test_admin.py
Added cleaning up thread local to tearDown()