build: check for qsort_r independent of platform

Rather than check for specific glibc version on PLATFORM_LINUX, check
the existance of qsort_r.

This fixes the following compile error with musl libc:

CC              src/main.o
In file included from src/main.c:39:0:
src/tvheadend.h:608:20: error: missing binary operator before token "("
 #if !__GLIBC_PREREQ(2,8)
                    ^
build: check for gcc version independent of platform

Use the gcc specific __GNUC__ and __GNUC__ minor to determine gcc version
rather than using the GNU libc specific __GNUC_PREREQ.

This fixes the following compile error with musl libc:
src/descrambler/capmt.c:79:18: error: missing binary operator before token "("
 #if __GNUC_PREREQ(4, 3)
                  ^