sheep: check gateway request as early as possible

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
sheep: set bit in vdi_inuse in atomic manner

sys->vdi_inuse must be operated in atomic manner because it is
manipulated by multiple threads. This patch implements a new bit
operator atomic_set_bit() and let get_vdis_from() use this.

Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>