Allow to easily toggle between thread safe sockets and non thread safe sockets through a ./configure flag

Thread safe here really just means enable the libevent level of thread safety.

Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>