s3:idmap_tdb: move the set_mapping code up