Close input file before returning in copyfile

Input file was not closed if it was not of normal file type
(eg. symlink) before returning.

Part of Ticket #69
Make sure compress.c always closes it's files

Changed compress and uncompress functions to use gotos to always make
sure that opened files are closed. Also remove closing of files from
compress_to_file_mmap as it was plain confusing.

This fixes part of Ticket #69
Move declaration of i in mem.c so it never will be unused

And remove the confusing 'i = i' warning silencer.
Part of Ticket #69
Change sprintf with same src & dest to strcat in botcmd.c

The result is undefined when using the destination as one of the
formatted arguments for sprintf.
Remove unread variable r in block_dns_hostbyip
Throw error if trying to set an invalid flag in global-chanset

This fixes last outstanding issue in Ticket #66.