dog/farm: fix closing negative fd

When executing dog cluster snapshot command, valgrind report
"Warning: invalid file descriptor -1 in syscall close()".

This patch fix the problem.

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