gni: reduce locking when progressing endpoint

After incrementing the static which variable, cache it before unlocking.

Remove locking around accesses to the local copy.
Add debugging.