encoding: null-terminate buffer in _FindOrMakeEncoding()

CR-fixed: 1225946
uiutil: null-terminate buffer in findbrowser()
ui: make sure buffers are null-terminated
autohint: avoid ptr-write after free in GDFindDStems()

MergeDStemInfo() does the processing and frees the data if trashed.
Populate the temporary stem data beforehand – this should probably
fix something in the function behavior.

CR-fixed: 1082647
Merge pull request #1521 from adrientetar/null

Null-terminate some buffers and fix a write-after-free