Support for gcc and clang colour diagnostics

Original patch provided by Lubos Lunak
https://groups.google.com/forum/#!topic/ccache/-Zehp1Zs3Lg

"-fdiagnostics-color=auto" is not supported as GCC determines that STDERR is not a terminal when commands are launched from ccache