add helper to do linear search and removing key in an array

This adds a type-safe version of lfind() and a helper to remove key in
an array, and simplifies complex manipulation of node arrays in the
cluster drivers.

This also fixes a memory boundary bug in do_leave_sheep().

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