Properly unmount the component when the shadow DOM is enabled

!!

This was fine with the shadow DOM disabled.

@nathansobo this feels like a big deal, but maybe there were actually no memory leaks caused.