Added validation for locked languages before setting weights
Provides a workaround for #3002532 to avoid a fatal error. The bigger issue seems to be that locked languages cannot be loaded as ConfigurableLanguage entities (at least in Drupal 10.1), so their weights cannot be updated.