htsp: reshuffle some code to prevent unexpected async messages on shutdown

valgrind reported:
   Invalid write of size 8
      at 0x43000F: htsp_serve (htsp_server.c:2510)
      by 0x4147D2: tcp_server_start (tcp.c:447)
      by 0x412250: thread_wrapper (wrappers.c:125)
      by 0x771CB4F: start_thread (pthread_create.c:304)
      by 0x7E97E6C: clone (clone.S:112)
    Address 0x11c30ca8 is 120 bytes inside a block of size 264 free'd
      at 0x4C27D4E: free (vg_replace_malloc.c:427)
      by 0x42FF27: htsp_serve (htsp_server.c:2488)
      by 0x4147D2: tcp_server_start (tcp.c:447)
      by 0x412250: thread_wrapper (wrappers.c:125)
      by 0x771CB4F: start_thread (pthread_create.c:304)
      by 0x7E97E6C: clone (clone.S:112)

The client was removed from the async list after all connections
were destroyed, but queues are part of the connection structure,
so sporadically, an async msg was queued after the queue flush.

This code change moves the async unlink before the connection
destroy call.
intlconv: Add some missing close calls (coverity)
access: coverity - handle negative value from base64_decode()
timeshift: reader - coverity - access to variable after free()
config: wrong map fix in v6 migrate (coverity)
tcp: fix memory leak in error path in tcp_server_create() (coverity)
imagecache: coverity - fix wrong unlink() call
huffman: remove wrong htsmsg_destroy() call (coverity)
http: handle negative value from base64_decode (coverity)
imagecache: fix the url variable initialization for error path (coverity)
trap: fix digest variable initialization (coverity)
tcp: connect - fix another memory leak (coverity)
fsmonitor: coverity - fsmonitor_fd cannot be negative
htsp server: fix wrong fd condition (coverity)
fsmonitor: coverity - fix variable access (beyond)
coverity: fix memory leak in idnode_filter()
prop: add extra assert to prop_read_value()
idnode: coverity fix variable initialization in idnode_filter_init()
service: fix service_class_caid_get() snprintf - coverity
tvhlog: tvhlog_thread - remove dead code (coverity)