Core: clear widget's parent on removal from the window.

Fixes some nasty segfaults.