When operating on a worktree, got locks the tree in order to avoid
problems with concurrent operations. Until now, got always used
exclusive locks, which caused problems when e.g. two separate parts
of the FreeBSD release build ran 'got tree' at once.
This has been fixed upstream but the 15.2 release cycle needs the
changes urgently and can't wait for the next got-portable release,
so cherry-pick those patches.
Sponsored by: Amazon
MFC after: 1 minute