Fix possible dead object error in leavewindow

git-svn-id: http://svn.wxwidgets.org/svn/wx/wxPython@74796 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Also perform 'self' check in _SetState since it may also be invoked by CallLater 

git-svn-id: http://svn.wxwidgets.org/svn/wx/wxPython@74797 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775