Allow for clean exit on AppDomain unload.

In a "hosted" scenario, the shell might be hosted in an alternate AppDomain
so that it can be loaded/unloaded independent of the process. This change
allows the unload to happen cleanly (without a rude threadabort tearing
through stuff).