fix bug in th_cd_timedwait()