Correctly handle empty string on setting document.title

Fixes #2970 by only creating a text node if the new value for document.title is not an empty string.