[2.3][Locale] Fixed: StubLocale::setDefault() throws no exception when "en" is passed

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Same as #8846 for 2.3+.