cec: always wait for thread exit in CThread's desctructor