cec: fix possible deadlock when starting a new thread