core.c: Add and use is_gid_not_zero() method instead of checking first byte

Signed-off-by: Ilya Nelkenbaum <ilyan@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>