Fix cookie handling for pagination

The current way in which PrestaShop handles pagination cookies is badly broken. If a cookie is set, then the value in the cookie overrides everything (including GET params). That means that once you set the cookie the first time, there is no way to change your preference. Even if you change the `nb_item` selector, the cookie overrides it.

You can test this on a default prestashop install by doing the following:

1. Change a product list to show (e.g.) 24 items per page.
2. Now change it to show 12 items per page. You can't, because the cookie that was set in step 1 overrides the GET request.

This patch fixes that behaviour so that:

- Cookie value is used if no GET param is present
- If a get param is present, then it takes precedence and the cookie is updated accordingly.
- Instead of updating the cookie on every request (which is unnecessary), the cookie is only updated when the GET param signals a change.