lock_packed_refs(): allow retries when acquiring the packed-refs lock