Don't assume that console exists.

See Ira's note on gh-398: IE 8 doesn't define console until the console is actually opened.