blk: check the return value of pthread_mutex_lock()