Wrap setting the document title into an own function to work around bugs in Chrome.