[core] fix potential streaming tempfile corruption (fixes #2760)
[core] fix potential streaming tempfile corruption (fixes #2760)

set O_APPEND after mkstemp() in chunk.c  (mkostemp() is not as portable)
(also set FD_CLOEXEC to avoid potentially leaking open tempfiles to CGI)

(thx dieter.ro for helping track this down)

x-ref:
  https://redmine.lighttpd.net/boards/3/topics/6884
  "potential tempfile corruption when streaming response"
  https://redmine.lighttpd.net/issues/2760

PatchyFog/lighttpd1.4-mbedtls,PatchyFog/lighttpd1.4-mbedtls,gstrauss/lighttpd1.4,gstrauss/lighttpd1.4,PatchyFog/lighttpd1.4-mbedtls,gstrauss/lighttpd1.4,PatchyFog/lighttpd1.4-mbedtls,gstrauss/lighttpd1.4,PatchyFog/lighttpd1.4-mbedtls,lighttpd/lighttpd1.4,PatchyFog/lighttpd1.4-mbedtls,lighttpd/lighttpd1.4,gstrauss/lighttpd1.4,lighttpd/lighttpd1.4,PatchyFog/lighttpd1.4-mbedtls,lighttpd/lighttpd1.4,lighttpd/lighttpd1.4,lighttpd/lighttpd1.4,gstrauss/lighttpd1.4