thread_timeout: fix bad comparison