Improve error handling in ctl com
Improve error handling in ctl com

If the ctl communication failed, the socket is now closed. We might want
to later add a restart of the ctl server thread.

nabilbendafi/haka,Wingless-Archangel/haka,LubyRuffy/haka,nabilbendafi/haka,lcheylus/haka,Wingless-Archangel/haka,LubyRuffy/haka,nabilbendafi/haka,haka-security/haka,haka-security/haka,lcheylus/haka,haka-security/haka,lcheylus/haka