in pthread_mutex_timedlock, avoid repeatedly reading mutex type field