Preserve 'extends' when the ShadowDOM polyfill patches document.register

Before this change this worked well in combination with the custom elements polyfill, however it failed with the native document.register.