improve type check of xbsearch

It is possible that 'key' is a const variable and 'base' is not, or
vice versa.  This patches allows such cases.

This also makes xbsearch() return the type of 'base' instead of a void
pointer.

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