fixed failed assertion during thread pool destruction

Fixes errors like these:
/usr/include/boost/thread/pthread/condition_variable.hpp:71: 
boost::condition_variable_any::~condition_variable_any(): Assertion `!pthread_mutex_destroy(&internal_mutex)' failed.

that appear when exception is raised during initialization stage (e.g. busy socket).