kernel - Fix rare lockmgr() state transition
* When lockmgr() is releasing the last count on an exclusive lock
with an upgrade request pending, and the atomic op fails, the
code fails to properly retry. Fixed by properly retrying.
* This situation should not be possible to even get into, hence 'rare'.
It requires UPREQ to be set while the lock is being held exclusively,
which should never be possible because there is no shared lock holder
in that case who might attempt to upgrade.
I checked race conditions when multiple shared holders attempt
to upgrade but all that happens is that one will release and
acquire a normal exclusive lock instead.