Use snprintf rather than sprintf in log_conncection()
Gaurd #include <alloca.h> with HAVE_ALLOCA_H for BSD