Add runtime shutdown hook.