Fix typo
Fix unused warning
Fix unsafe string handling in configs

Also fixes 2 leaks
Fix chanopts not saving if /quit before exit

This is the C fix, unfortunately a proper fix, e.g.
 removing the dependency on session_name all together is a much vaster
 refactor outside the scope of this bugfix.

Closes #1111
Create configuration option to control middle click tab close.

Some might argue that this shouldn't be able to be configured as it is "common" behaviour
in other programs such as web browsers, but for me it is an annoyance because for 15
years this has not been the behaviour of X-Chat.
Quite simply, this creates a configuration option for 537fb856, as unobtrusively as
possible, under the channel switcher preferences tab.

Closes #1232
Fix some warnings in xsys

- Remove unused code
- Fix leak
Fix some leaks
Fix possible overflow when using /menu
sysinfo: Simplify remove_leading_whitespace()

Also fixes a possible overflow
merge from hexchat master