app_terminal.py:  Fixed a bug in `TerminalApplication.detach_shared_terminal()` where it could result in an exception if it gets called when no terminals are shared (can happen as part of the callback chain if things are just right).