Strip duplicate querystrings from the url before adding document.location.search

When a querystring is passed with the url (for example Translatable locale) it is duplicated each time the content panel is reloaded, by adding document.location.search and so it should be stripped from the url first.
Merge pull request #2535 from Martimiz/3.1

Strip duplicate querystrings from the url before adding document.location.search