Sequenced shutdown events for graceful shutdown in Node