KEYCLOAK-588 retrieve window.location.origin in InternetExplorer-compatible way

https://issues.jboss.org/browse/KEYCLOAK-588

Based on http://tosbourn.com/a-fix-for-window-location-origin-in-internet-explorer/