fixes #2220465 Drush 301 Moved Permanently and #2262033 Secure Login redirects during cron by mfb and smokris