Handle locales more safely.
Switch to functions.
gfilechooser.c: Really fix the realloc procedure for gfc->history

gfc->hpos is the position of the current entry; new entry goes in
gfc->hpos+1, so there must be enough space for gfc->hpos+1 entries.
Merge pull request #1706 from jtanx/gfc

gfilechooser.c: Really fix the realloc procedure for gfc->history
Merge pull request #1696 from fontforge/locale_threadsafe_1

Handle locales more safely.