Fix thread-safety issue in stagecraft

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