Fix a bug in svnsync causing stale sync-locks on mirror repositories.
Fix a bug in svnsync causing stale sync-locks on mirror repositories.

* subversion/svnsync/main.c
  (get_lock): The lock attempt is done in iteration N, and success is
   checked in iteration N+1. Prevent the case where svnsync attempts
   to take the lock in the very last iteration, doesn't check for
   success, and ends up erroring out, leaving behind a stale lock.

Found by: Jon Foster <Jon.Foster@cabot.co.uk>
Based on patch by: philip


git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@884842 13f79535-47bb-0310-9956-ffa450edef68

YueLinHo/Subversion,wbond/subversion,YueLinHo/Subversion,YueLinHo/Subversion,wbond/subversion,YueLinHo/Subversion,wbond/subversion,wbond/subversion,YueLinHo/Subversion,YueLinHo/Subversion,wbond/subversion,wbond/subversion,YueLinHo/Subversion,YueLinHo/Subversion,wbond/subversion