Ensure `window.console` exists before calling it

Old IEs don't have a `window.console` API and stops the Javascript
execution of the rest of the page.