Redirect URL: support existing params

$url = "http://blah.com?x=y" . "?Z=" . $value;
will obviously not work because the query part of the url now has two ?s

Previously if your url already contained query params, the generated url
would be incorrect.