Completely fixed the temp file creation to use portable functions.
Completely fixed the temp file creation to use portable functions.

- Fixed also the code under under HAVE_CURSES_H
- The new code is secure as much as the library allows, documented in issue #381

hunspell/hunspell,hunspell/hunspell,hunspell/hunspell,hunspell/hunspell