Refactor ccnet_processor_done() and shutdown() logic.