dog/vdi: fix bad address error in dog vdi check

We can use dog vdi check to repair the vdi if some replica is lost.
When creating a erasure coded vdi and some data replica of the vdi
is lost, we run dog vdi check and will see the following error log
sometimes:
failed to write to socket: Bad address
If you don't see the error, you will find the file length of the
recoverd replica is not correct. It is because the replica buffer
length is not set correctly. The buffer overflows, so we get
Bad address error. This patch add the buffer length parameter for
write_object_to() function and set the buffer length correctly.

Signed-off-by: Bingpeng Zhu <bingpeng.zbp@alibaba-inc.com>
Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>