Fixes Redmine #1855: don't close file descriptors we use
Merge pull request #621 from jooooooon/bug_1855/avoid_random_syslog_outputs

Fixes Redmine #1855: don't close file descriptors we use
Unlock cft_count lock before returning in case of empty list.

'list' should never be NULL, given that the function receives the address of the
list pointer, and the only call passes in &CONNECTIONLIST.

This fixes up commit e302e38e0efdb33fcd53ec7acc41686214dbc6ea
(cherry picked from commit f561f5eceb22881ab8f86119645cc08ccaa3a0ca)
Don't protect malloc call with system mutex in main server loop.

Not required to synchronize malloc calls, it's threadsafe on all supported platforms.

This partially backports f55a6610fbfcd078c1e2a58cd0da94efef35cc2d