CMake fixes/updates:
- properly support MinGW / MinGW-w64
- check for -fvisibility=hidden before adding (for old compilers)
- check for -std=c99 before adding (for really old compilers)
- check for alloca.h presence and adjust its inclusion
- check for inline keyword and adjust common.h for it
- check for __builtin_expect and adjust common.h for it
- set project language to C