The else branch for non-lock errors was incorrectly triggered on the
final retry attempt of a Qdrant lock error, causing it to log ERROR
and raise immediately rather than fall through to the lock-exhausted
path. This tripped the circuit breaker during startup when WebUI and
gateway processes competed for the lock.
Fix: add a comment to skip the else on last lock-error attempt, and
downgrade the exhausted-retries log from ERROR to WARNING since lock
contention is expected and not a hard failure.
Add _LOCK_RETRY_ATTEMPTS (10) and _LOCK_RETRY_DELAY_S (0.8s) constants.
Retry loop in _get_memory() retries on Qdrant portalocker errors with
jitter, non-lock errors still fail fast. Add explicit del mem after each
operation to release the lock ASAP. Fix record_failure ordering in search
and add so lock errors are tracked correctly.