Clear the window pointer upon destroy

This does not happen today, but it is more correct