Ensure that Twig form themes are always a list, not a hashmap

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #12305
| License       | MIT
| Doc PR        | n/a

array_unique does not reindex arrays when deleting keys.