use a reasonable timeout for both iomux_run() and pthread_cond_timedwait() in the multif aysnc thread
cast to int when checking if the caller is querying the actual value

instead of setting a new one (by passing -1 as new value)