sheep: flush cache for snapshot creation

This fixes a panic for such case with object cache enabled:

1 VM is running and take a live snapshot by qemu-img or collie
2 after snapshoting, there are some dirty objects in the cache
3 sheep will try to push these dirty objects but sheep gateway return READONLY
4 sheep gat paniced because pusher will assume it never fails

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
util: consolidate atomic_create_and_write to be concurrency friendly

Only one thread can call this function on the specified path.

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
sheep: introduce xfallocate and xftruncate helpers

These helpers retry the syscalls while the error is retry-able.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>