This is done to ensure we clean up not just wbt_term_in_lang, but also wbt_text_in_lang and wbt_text.
The maintenance script shouldn’t need to do much more than call TermStoreCleaner::cleanTermInLangIds(), after checking that the term really isn’t used anymore.
Script to be located in repo/maintenance/.