Remove tid parameter from uhi lock routines as it is not needed.

This also resolves an issue with using locks in tls key destructors,
as curthread was being used to supply the tid parameter value in the
locking calls, and curthread is implemented using a tls key (so before
this change, using locks in tls destructors introduced a
destructor-ordering hazard).