Fix issue with updating basket cookie in the middleware

Handle the case correctly where the basket cookie needs to be deleted
and updated in the same request. This can happen when unfreezing the 
basket. Django's response.delete_cookie doesn't remove the cookie from
request.COOKIES so we need to manually check this.
Use Django settings for the history cookie.
Merge branch 'feature/recently-viewed-settings' into lukkien
Merge branch 'fix-basket-cookie' into lukkien