autotools: remove old sockets and locks

socket and locks saved in $XDG_RUNTIME_DIR remian there when test
fails. Remove them by make clean.
events: fix off-by-one mistake

I forget about terminating zero
client: wrap long lines

some lines were longer than 80 characters
client: cleaning code

remove useless dbg messages and trailing whitespaces
test-runner: fix syntax error

I haven't discovered this error before since it was not compiled with libunwind
test-runner: cleaning code
events: clean code

longer lines, dbg, etc..
events: few sanity asserts

check functions arguments
server: remove unused function

may be implemented later, but it's unused atm, so delete the code
server: add comments

at least to static functions
protocol: fix codingstyle