Fix CORS in devhub test receipts (bug 1104371)

This also fixes the CORS decorator which was
previously broken for OPTIONS requests.

@mstriemer r?
This might make it more confusing but seems equivalent and reduces the nesting a level.

```python
def cors_api_view(methods, headers=None):
    # The request.CORS attributes need to be added to the view before
    # the DRF @api_view handler executes.
    api_view_f = api_view(methods)(f)

    @functools.wraps(api_view_f)
    def view(request, *args, **kw):
        request.CORS = methods
        if headers:
        request.CORS_HEADERS = headers
        return api_view_f(request, *args, **kw)
    return view
```