tdb: add overflow detection to tdb_expand_adjust()