server: break the event loop on SIG{INT,TERM} and free resources

After this patch the benchmarks are passed without any errors, while
before there are some becuase of non-clean exit, it can't create socket
because of non-closed sockets on previous server shutdown.
This patch also fix leaking of some libevent structures, and now
valgrind shows leaks only in boost::log.

I've checked benchmarks multiple times, no errors occurred.