Fixed 'NoneType' object has no attribute '_leaveSignal' error on mac.

This was presenting itself on shutdown after the node menu had been shown. I simplified the menu code down to isolate the problem but couldn't see anything wrong there in terms of ownership or cycles, so just did the pragmatic thing and added a test for None-ness in the leave event handler.