Move up set_utf8_program_locale()
Move up set_utf8_program_locale()

This is needed in order to establish the program locale early,
so setlocale(LC_CTYPE, NULL) will return the correct locale.

This matters for dictionaries that don't define the locale, when
the user's locale doesn't have UTF-8 codeset.

Because the locale setting stuff is subtle, add detailed comments.
Also rearrange and improve existing comments.

ampli/link-grammar,ampli/link-grammar,opencog/link-grammar,linas/link-grammar,opencog/link-grammar,ampli/link-grammar,opencog/link-grammar,linas/link-grammar,linas/link-grammar,opencog/link-grammar,linas/link-grammar,ampli/link-grammar,ampli/link-grammar,linas/link-grammar,ampli/link-grammar,linas/link-grammar,opencog/link-grammar,linas/link-grammar,linas/link-grammar,opencog/link-grammar,ampli/link-grammar,linas/link-grammar,opencog/link-grammar,opencog/link-grammar,ampli/link-grammar,ampli/link-grammar,opencog/link-grammar