r19426: merge nearly all the differences between Samba3 tdb and Samba4