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>