Add onShutdown handler to ProcessManager