Don't lock the world on initial run

On large amounts of repos (*cough* codeaurora *cough*), attempting to
lock 3500 entries will understandably fail with "too many open files."
This change only locks repos while we're trying to actually do something
with them.