Implement quiet period and timeout for graceful shutdown