bugfix: only remove shutdown-hook when we're doing a regular shutdown. If an unexpected shutdown is going on, this usually means that the shutdown-hook already was triggered, so it can't be removed during the shutdown itself.
Authored by: mrieser 2009-06-02
Parent: [r7241]
Child: [r7243]