Fix issue #1340 - Redirect loop on search

Fixed redirect loop which occurred on multi-word search or when search query contained special characters and the 'redirect ugly URL's' option was on.
I seem to have been a bit too zealous trying to escape unsafe $_SERVER variables before ;-)
Merge branch 'Issue-1340' of https://github.com/jrfnl/wordpress-seo into jrfnl-Issue-1340

Conflicts:
	readme.txt
Merge branch 'jrfnl-Issue-1340'