clvmd: use dm_zalloc for socket allocation

Instead of doing individual settings for struct members,
ensure whole struct is in defined state.
clvmd: fix memleak on exit

This patch will releases allocated private resources from
startup. Needs previous dm_zalloc patch to ensure unset
private pointer is NULL.

TODO: check on real cluster.
dmeventd: remember number of log disablings

Individual events are handled through separate threads,
so once we have more then a single thread in this eventwait
sleeping, we got race on the dm_log setting, since
if one event is timeout out on alarm, while another is still waiting,
then dm log has been restored to NULL and the next sigalarm
has been reported as error.

Fix it by introducing counter which is protected via mutex,
and only when the last event is released, logging is restored.

TODO: libdm seems to have some static vars which may audit
for this type of use.
dmeventd: wakeup timeout thread earlier

When the last entry in the timeout queue is unregistered,
wakeup sleeping condition, so the thread is deleted earlier.
So the thread resource is release earlier.

Also when monitored with tools like valgrind this eliminites reported
leak.
cleanup: clvmd reindent lock_vg code

Code had wrong indent level, improve readability.
cleanup: clvmd rewrite send_message

Improve readability of code and make it clear what it tries
to achieve.
cleanup: clvmd simplify loops

Rewrite write loops to be more readable.
cleanup: clvmd indent changes

Improve readbility of clvmd code.
Remove some unneeded braces.
cleanup: clvmd assign NULL to pointers

Use NULL when assigning to void*.
cleanup: clvmd use else if

When string already matches, skip rest of tests.
cleanup: clvmd use struct initializers

Simplify code, and use compiler capability to
initilize struct members on its own.
cleanup: dmeventd code simplified

Improve readbility of code.
cleanup: dmeventd convert multiline to single line

Instead of doing multiple different calls, select
stream within a condition.

Replace fprintf with fputc for '\n'
tests: reuse existing check dev_md5sum

Create md5sum in reusable way and use exiting check function.
tests: improve wait for open

Add loop to detect open device from 'sleep <'
tests: skip another kernel

This kernel has still buggy kmem_cache debugging so skip it for raid456.
tests: skip valgrind testing when assigned to 0

When LVM_VALGRIND_CLVMD/LVMETAD is set to 0  skip testing.
(Proviosly any value caused to run valgrind testing,
so now '0' skips testing))
tests: workaround bash bug

Seems new bash4.3 is somewhat buggy
https://bugzilla.redhat.com/show_bug.cgi?id=1074202

Put in cheap workaround for now.
tests: drop unused make_ioerror
tests: aux adds kill_sleep_kill_

Move common code to subfunction