Fix external Thesaurus id generation
Fix https://mantis.culture.fr/mantis/view.php?id=18307