build: Cleanups and fixes for a newer clang toolchain by Smjert · Pull Request #8412 · osquery/osquery

@Smjert

- Force the use of the DWARF debug symbols version 4,
  since only very recent versions of gdb support any version higher than
  that and on newer clang versions, 5 is the default.

- Correct the secure_getenv check; GLIBC 2.17 is the first version
  that adds supports for it, so it should be included

- Move the selection of the standard library implementation and
  corollary library on Linux to be a toolchain specific setting,
  making it slightly easier to build with a different toolchain.