core: shutdown write scheduler with a timeout