Use bsddb.db instead of bsddb, since the latter is deprecated
Set the right mode for db