Avoid unnecessary cleanups during immediate shutdown