r19401: make tdb_lockall() much more efficient, and add a tdb_lockall_read()