tools: compiler-gcc.h: Guard error attribute use with __has_attribute