sheep: fix memory leak at create_client()

The current create_client function does not free client_info structure
when getpeername() failed.

This fixes the leak bug.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Reviewed-by:Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
sheep: fix memory leaks at start_deletion()

The start_deletion function does not free the deletion_work structure
nor the buffer (dw->buf) that it locally allocated when it deletes
inode of the VDI or dw->count was equal to zero.

This fixes these leak bugs.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Reviewed-by:Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
sheep: check EAGAIN for all the sd_lock helpers

Some users report that:

[root@pangkvm01 sheepdog]# cat sheep.log.bak |grep "Dec 16 23"
Dec 16 23:34:22  ERROR [main] modify_event(156) event info for fd 106 not
found
Dec 16 23:40:24  EMERG [io 5574] crash_handler(250) sheep exits unexpectedly
(Segmentation fault).
Dec 16 23:40:24  EMERG [io 7281] sd_write_lock(307) PANIC: failed to lock
for writing, Resource temporarily unavailable
Dec 16 23:40:24  EMERG [io 7281] crash_handler(250) sheep exits unexpectedly
(Aborted).

It means some posix lock funcitions can return what is not documented in manual.
So it's better for us to defensively check it rather than panic out.

Reviewed-by:Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
sheep: let init_vdi_state() return correct value

Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>