[entropy.db.sqlite] do not acquire the repo lock if it's not strictly needed

Try to avoid to acquire the repository lock in exclusive mode if
it's not strictly needed. We were acquiring the lock in exclusive mode
even when there was nothing to update due to schema changes.