Use createElement if namespaceURI is undefined.

Normally selection.append is only called on normal elements that have a defined namespaceURI. However, if createElement is called on a shadow root, then namespaceURI is null. Now we correctly fallback to createElement instead of createElementNS in this case. Fixes #2161.