sql: fix optimistic locking with the sql index
walker: discard all irregular files, not just directories