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
Merge pull request #268 from alphagov/bugfix/thread-safety

Fix thread-safety issue in stagecraft
Allow cross-origin resource sharing on dashboards

The public dashboard endpoint should allow requests from everywhere,
for example the performanceplatform-big-screen-view.
Merge pull request #271 from alphagov/cors-dashboard

Allow cross-origin resource sharing on dashboards