fix: cmake -DSTATIC_LINK=ON on Linux/macOS (#1340)
Make linking dependent libraries as static a hard requirement when
STATIC_LINK is ON, as opposed to the previous behavior of falling back
to dynamic libraries.
A side-effect of this is that if only a dynamic zstd/hiredis is
available on a system, it will not be found, and the download and build
code will be invoked to build a static version from the internet.
Add a general case to handle Linux, macOS and similar by linking
libgcc/libstdc++ statically on gcc/clang.
Move the code into cmake/StaticLinkSupport.cmake and include it from the
main file.
Fix #1330
Signed-off-by: Rafael Kitover <rkitover@gmail.com>