locking/locktorture: Pass thread id to lock/unlock functions