Fix failure to build from source with modern _host_ glibc/gcc.

One should not define __USE_GNU directly, and instead _GNU_SOURCE
should be defined as early as possible, before first (indirect)
inclusion of features.h

Change-Id: I4d109d4fa0c3d266b873d2a0a66a52e1a4faa234
Signed-off-by: Dmitrijs Ledkovs <dmitrijs.ledkovs@canonical.com>
toolbox: silence some compiler warnings

Comparison of signed and unsigned integers. Use parenthesis around a
group of bitwise OR operations.

Change-Id: Ia404380593ce2c2a291133c07c0fc7a016a3ad3f