TST: correctly predict locale setability

Don't join the lang and encoding when performing the trial set, because

    locale.setlocale(locale.LC_ALL, ('it_CH', 'utf-8'))

succeeds, but

    locale.setlocale(locale.LC_ALL, 'it_CH.utf-8')

throws locale.Error.

Closes #5537.