fix race condition in collator on shutdown