region: Fix crash in keyboard layout population

The previous code would crash if 'variants' was null and 'layouts' had
more than one element in it.
11 jobs for fix-keyboard-layout-crash in 4 minutes and 16 seconds (queued for 3 seconds)