collie: print subcommand usage when function return EXIT_USAGE

Output before:
$collie vdi create test
Please specify the VDI size

Output after:
$collie vdi create test
Please specify the VDI size
Usage: collie vdi create [-P] [-c copies] [-a address] [-p port] [-h] <vdiname> <size>
Options:
-P, --prealloc          preallocate all the data objects
-c, --copies            specify the data redundancy (number of copies)
-a, --address           specify the daemon address (default: localhost)
-p, --port              specify the daemon port
-h, --help              display this help and exit

Signed-off-by: Kai Zhang <kyle@zelin.io>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
collie: allow calling queue_work() in done()

Currently, if we call queue_work() in the second event_loop(),
work_queue_wait() cannot wait for completion of the work.

This adds a field 'nr_workers' to the worker_info and makes
work_queue_empty() return true only if both worker_routine() and
worker_thread_request_done() have no outstanding works.  I think this
removes a race condition in work_queue_wait() completely.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
event: use specified timeiout for epoll_wait

There is no need to wait 1 second every time.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
tests/008: wait for sheep to finish recovery

'collie vdi write' can finish before sheep recovers all the objects,
so it is safe to wait for sheep to complete recovery.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
tests: reboot sheepdog without collie shutdown

The current master can lose objects if we restart sheepdog without
'collie cluster shutdown' several times.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
sheep: get object list from stale directory

If we stop sheepdog when we have no replicas in the working directory,
sheep cannot recover the objects after restarting.  It is because
sheep doesn't look into the stale directory when creating a object
list.  This fixes the problem.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
sheep: get vdi bitmap from joined node

If we stop sheepdog without the shutdown command, the number of nodes
will be rapidly reduced and it will easily happen that all the
replicas are lost.  In such case, it is better to get vdi bitmap from
the newly joined node too so that we can recover so many vdis as we
can.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
[tmp]

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
[tmp] change _random

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
collie: fill screen_width to make error message show at the head of line

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