Fix thread-safety issue in stagecraft

Django middleware is not thread-safe. We should store this context on
the request object instance.

Django always calls `process_response`, but it is possible that
`process_request` has been skipped. So we have a guard checking that
it’s safe to log the response time.

See https://docs.djangoproject.com/en/1.7/topics/http/middleware/#process_request