Fix #3976 - validate and normalize user-supplied URI for http_login.rb

URI should be validated and normalized before being used in an HTTP
request.
Fix jenkins when CSRF is enabled
Retry the script page request to get the token

After logging in to Jenkins the script console page
needs to be requested again to get the CSRF token.
Merge pull request #1 from zeroSteiner/fix-pr4020-login

Retry the script page request to get the token
Land #4020, Jenkins-CI CSRF token support
Land #3979, @wchen-r7 fixes #3976, http_login not using TARGETURI, neither uri normalization