Eliminate double-execution of shutdown code.