cec: fix some threading related bugs, like trying to join with a detached thread...