Shutdown improvements

This includes more fixes for object lifetime issues, and a new shutdown check for UI lifetime issues. Given that the new check has already revealed several issues with the core gaffer apps (which I've fixed here), I wouldn't be at all surprised if it reveals issues with internal IE apps as well. If there are problems, it will just mean disconcerting messages at shutdown, but you might want to do some internal testing before merging to see how likely that is to be bothering people. Alternatively (and my preference I think), we could branch maintenance for the current IE builds, allowing us to merge as-is and develop Gaffer a bit more freely alongside Cortex 9 for a while.